Some lessons have been learnt while translating Sigmah internationalization files, and this wiki page is here to share them for new translators.
Sigmah is using the Pootle online software translation platform for translation. Our Pootle server is located at http://pootle.sigmah.org/
After two years of kind free hosting on Sahana HFOSS own Pootle server, we have shifted to our own server because the latest 2.5 Pootle version they migrated to is buggy with Java .properties based projects. Thanks Sahana again for those 2 years of kind hosting! Our Poootle server remains with old 2.1.5 version.
The community of the Liferay project has written a good introduction guide for Pootle. You can read the following and replace each word “Liferay” by “Sigmah” and you'll get a user manuel !
Pootle User manualfor project Liferay
MailModels
and UIMessages
files, and does not apply to UIConstants
files. We know, it is not obvious and natural when you're typing… but the exported file from Pootle won't do the job for you, and if you don't enter the simple quote by pairs ( instead of ' (ie: -window
s title- instead of -window's title-)), the file generated from your translation will break the build. Of course, your file will be controlled before being used in the code, but two controls are always better than only one. :)MailMessages
file contains only 16 strings, so you can't have the “My Account > Settings > Number of rows” to a value greater than 16.The internationalization files are the following ones:
src\main\resources\org\sigmah\client\i18n\UIConstants.properties
src\main\resources\org\sigmah\client\i18n\UIConstants_$$.properties
src\main\resources\org\sigmah\client\i18n\UIMessages.properties
src\main\resources\org\sigmah\client\i18n\UIMessages_$$.properties
src\main\resources\org\sigmah\server\mail\model\MailModels.properties
src\main\resources\org\sigmah\server\mail\model\MailModels_$$.properties
For understanding the difference between the files with a language code suffix (“_$$
” stands for “_es
”, “_fr
”, etc.), see Rules for coordination with translators .
Do not remove source strings from the property files. Static analysis via the Java will safely identify unused methods in the UIConstants and UIMessages interfaces. Removal of unused methods should be conducted periodically by the development team.
The management of the file upload, in the “Overview” tab of the language translation project, can be quite tricky and is not very intuitive in the first place.
A good general lesson to remember is: “a *
.properties file for first importation, and XLIFF generated file for second one”.
The first importation of a file in a language takes as granted that you send this file as a new source file in the original language for this new translation project. The name of the file has to be strictly the same as the potential similar one in other language, in order to let translators be able to see translations of a string in all available languages. You have to go to the “Files” tab of the language translation project and click on “Rescan project files” to actually process this source file.
All second importations are taken as importation of translations, if similar file name exist, and no more as import of source file, whatever the option used for importation.
NB: since you need to use the command “Review the project's files” in the procedure to update the source strings of a file, you always need to update the strings of all the files of a translation project because this command has effect on all files of the project and can put the other files of your project in an incoherent status.
NB2: the UIConstants file is so big that it creates issues on importing its translation into Pootle: Pootle returns a “502 Proxy Error” (Reason: Error reading from remote server) before the end of step 5 below. As a consequence, not all translated strings are updated. And from different trials, you will get a different number of remaining strings to translate. Advices to reach the maximum number of old strings automatically translated again : (i) import XLIFF file of UIContacts before other XLIFF files, (ii) try several times…
To update source strings of a translation project, the following procedure has to be used:
Things to take in mind:
*.properties
exported files from Pootle with the suffix of the target language (_fr
, _es
so far).UIMessages
and MailModels
files exported from Pootle do not contain any simple quote (') (or triple quotes…) which is not doubled (this does not apply to UIConstants
). Each simple quote should be preceded by a second one ( instead of ' (ie: -window
s title- instead of -window's title-)). Two solutions for that:(^['][^']|[^'][']$|[^']['][^']|''')
UIMessages
files have all required parameters. Easiest almost exhaustive solution for this check is to search for all {1}
in the files: if there is a {1} without a {0} in the same string, it should be corrected.