Add translation support #101

Closed
opened 2020-07-09 20:39:10 +00:00 by igi0 · 7 comments
igi0 commented 2020-07-09 20:39:10 +00:00 (Migrated from gitlab.com)

Thanks for this nice project!

I would like translation capability for string resources is added.

Thanks for this nice project! I would like translation capability for string resources is added.
tslocum commented 2020-08-28 23:21:44 +00:00 (Migrated from gitlab.com)

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.

I've added support for using TinyIB in other languages. I reached out to [Weblate](http://weblate.com) to add TinyIB so anyone may contribute translations there. I will close this once that's available.
igi0 commented 2020-08-29 08:23:27 +00:00 (Migrated from gitlab.com)

What are the steps to add a new translation?

Here is what I tried, that did not work:

  1. Cloned the file locale/tinyib.pot to locale/it.po and translated some strings;
  2. Set define('TINYIB_LOCALE', 'it'); in settings.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 command msgfmt it.po -o it/tinyib.mo
Translations are still not shown, either reloadind the page or rebuilding the db.

What are the steps to add a new translation? Here is what I tried, that did not work: 1. Cloned the file `locale/tinyib.pot` to `locale/it.po` and translated some strings; 1. Set `define('TINYIB_LOCALE', 'it');` in `settings.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 command `msgfmt it.po -o it/tinyib.mo` Translations are still not shown, either reloadind the page or rebuilding the db.
tslocum commented 2020-08-29 15:21:23 +00:00 (Migrated from gitlab.com)

(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 named LC_MESSAGES. The translated tinyib.po/tinyib.mo should be placed within LC_MESSAGES.

(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 named `LC_MESSAGES`. The translated `tinyib.po`/`tinyib.mo` should be placed within `LC_MESSAGES`.
igi0 commented 2020-08-29 22:16:27 +00:00 (Migrated from gitlab.com)

I could not make it work. I have these additional files:

  • locale/it/LC_MESSAGES/tinyib.po
  • locale/it/LC_MESSAGES/tinyib.mo
I could not make it work. I have these additional files: - `locale/it/LC_MESSAGES/tinyib.po` - `locale/it/LC_MESSAGES/tinyib.mo`
tslocum commented 2020-08-30 16:04:44 +00:00 (Migrated from gitlab.com)

Please verify that your installation supports gettext by creating a file with the following contents:

<?php
phpinfo();

The text --with-gettext= should be present in the Configure Command.

I will clarify this requirement in the README.

Please verify that your installation supports gettext by creating a file with the following contents: ``` <?php phpinfo(); ``` The text `--with-gettext=` should be present in the Configure Command. I will clarify this requirement in the README.
igi0 commented 2020-08-30 20:57:44 +00:00 (Migrated from gitlab.com)

The text --with-gettext= should be present in the Configure Command.

I do not get this, but I get a table like the following for the installed modules:

GetText Support enabled

PHP Version 7.3.19-1~deb10u1 in Raspbian (Raspberry Pi4).

> The text `--with-gettext=` should be present in the Configure Command. I do not get this, but I get a table like the following for the installed modules: | | | | ------ | ------ | | **GetText Support** | enabled | PHP Version 7.3.19-1~deb10u1 in Raspbian (Raspberry Pi4).
tslocum commented 2020-08-31 19:37:31 +00:00 (Migrated from gitlab.com)

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.

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](https://github.com/php-gettext/Gettext) instead.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: tslocum/tinyib#101
No description provided.