Add translation support #101
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: tslocum/tinyib#101
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Thanks for this nice project!
I would like translation capability for string resources is added.
I've added support for using TinyIB in other languages. I reached out to Weblate to add TinyIB so anyone may contribute translations there. I will close this once that's available.
What are the steps to add a new translation?
Here is what I tried, that did not work:
locale/tinyib.pot
tolocale/it.po
and translated some strings;define('TINYIB_LOCALE', 'it');
insettings.php
;After step 2, reloading the page does not show the translations; rebuilding the page does not show the translations.
So I also created the file
locale/it/tinyib.mo
file, with commandmsgfmt it.po -o it/tinyib.mo
Translations are still not shown, either reloadind the page or rebuilding the db.
(Once Weblate approves TinyIB these manual steps won't be necessary)
To manually translate, create a folder in
locale/
with your language code as its name, then create a subfolder within it namedLC_MESSAGES
. The translatedtinyib.po
/tinyib.mo
should be placed withinLC_MESSAGES
.I could not make it work. I have these additional files:
locale/it/LC_MESSAGES/tinyib.po
locale/it/LC_MESSAGES/tinyib.mo
Please verify that your installation supports gettext by creating a file with the following contents:
The text
--with-gettext=
should be present in the Configure Command.I will clarify this requirement in the README.
I do not get this, but I get a table like the following for the installed modules:
PHP Version 7.3.19-1~deb10u1 in Raspbian (Raspberry Pi4).
PHP requires the system have the requested locale installed to use translations available for that language. This is a bizarre requirement and it makes using Gettext for this unfeasible. I will implement translation handling using php-gettext instead.