I18n in Tuleap should always be done with Gettext.
To extract translated strings and add them to the .po
files for
translation, you should always run the following command:
$ make generate-po
This will parse all Tuleap code (core and plugin). If you want to limit the work to a plugin (to speed up the extraction):
$ PLUGIN=git make generate-po
Then .po
files can be edited with the editor of your choice. We mostly
use Poedit which helps to remove obsolete
translations and add checks (like translation that should end with same
punctuation mark than source string for example).
Contributed files should not contain:
- fuzzy strings
- obsolete strings
The list of currently available languages can be seen here: available-languages
Contribution should respect .po
files structure. Each component in
Tuleap has its very own .po
files and should be contributed as is.
Merging of .po
files for contribution is not supported.
Your language is not in the list? Contributions are most welcome!
In short, the process is the following (example for Brazilian Portuguese
pt_BR
):
-
If it is not already done, Clone Tuleap Sources
-
Create folder for your locale:
mkdir -p site-content/pt_BR/LC_MESSAGES/
-
Define how the language should appear in the user preferences selection:
echo -e "system\tlocale_label\tPortuguês brasileiro" > /etc/tuleap/site-content/pt_BR/pt_BR.tab # if you have a running environment you will need to clear the cache in the container # with `tuleap --clear-cache` to take into account the new entry
-
Translate
-
Copy a
.pot
template into your language. A good start is Tuleap core.make generate-po # This is needed to create up to date .pot templates cp site-content/tuleap-core.pot site-content/pt_BR/LC_MESSAGES/
-
Edit the new file (don't forget about .po headers)
-
Repeat
-
Please contact us beforehand to make sure that there isn't already an ongoing contribution in the same language by someone else.
We plan to use an external system like Crowdin or Weblate to ease translation contributions, but no progress has been made on this subject. Stay tuned!
Depending on where you are in Tuleap code, you should follow recommendations to translate your strings: