Wiki

Uploading properties files to Pootle

One of the Pootle features is the ability to upload properties files. This option allows translators to use any tool to translate Liferay, thus avoiding the Pootle UI:

Pick-up a project and a language from your Pootle home page

Go to "Translate" tab

Click on "Export", the Language.properties file will be downloaded

Use the tool of your choice to edit the file

Return back to the "Translate" tab, then upload the file in Pootle

Depending on your role in Pootle, you will be able to tell Pootle what to do with the file:

If you are a translation leader, you will be able to overwrite translations on Pootle DB with those in the file ("Overwrite the current file if it exists") or preserve what is on the Pootle DB ("Merge the file with the current file and turn conflicts into suggestions").

If you are a contributor, you will be able to suggest the translations contained in the file ("Add all new translations as suggestions").

We would like to talk about several things related to this procedure. They are not issues per-se, but if you are not aware, they can cause a bit of headache. They are gathered from our user's experiences. In addition, we try to provide some advice in order to avoid misunderstandings.

Untranslated keys are also downloaded

Let's suppose that the project translation is 85% complete. This roughly means that 15% of the keys have no translation for your language. When downloading the file (see step 3 above), Pootle will include those untranslated keys, and their value will be the one given in Language.properties file (that is, the en_US value).

If you accidentally change any of their values, when file is uploaded back to Pootle, those values become new translations to your language. To Pootle eyes, those keys are correctly translated and contribute to the overall translation progress (i.e they no longer appear in the "Quick translate" list). Moreover, if you upload a file containing only those keys you have translated, and select option "Overwrite the current file if it exists", then you will delete from pootle DB all keys not contained in the file you just uploaded.

Our advice here is to be sure that you upload correct keys, so Language files modified outside Pootle sholud be double-checked.

Make sure you upload an ASCII-encoded file

When you export a Language file from Pootle, you get an ASCII encoded file. Please take into account that Language_.properties files available on our git/svn repos are UTF-8 encoded. This means that you should not grab a file from SVN, make some translations and upload it into Pootle. Moreover, you need to make sure that your editor or tool has not changed the encoding after saving the file.

Our advice here is to check the file encoding before uploading it to Pootle. If you use Linux, a quick way to check the encodings is described below using the Catalan language as example:

1. Export the Language_ca.properties from Pootle into /var/tmp. Check the encoding and see how special characters (such as tildes) are escaped: