Translations imported

The language files from the GLM svn repository have finally been imported into Launchpad Translations. You can see the progress of each language with the Translation overview on Launchpad (click on “View all languages”).

Translation progressThe translation files had been in the GGL bzr repository for some time now, but they weren’t being imported by Launchpad. In order for the translation files to be automatically imported, one must follow the Import policy. This policy describes the following rules when uploading translation files:

  • The file must be in GNU gettext .po format.
  • Translation files should be in the same directory as the template to which they relate.
  • The translation files should be named for the appropriate language code: e.g. pt_BR.po for Portugese as spoken in Brazil or fr.po for French as spoken in France. Launchpad only accepts languages that have an ISO 639 code.

The second rule was a problem. PHP looks in the folder `locale/xx_XX/LC_MESSAGES/` for language files and this can’t be changed. Here `locale` is the directory for storing language files, `xx_XX` is the appropriate language code, and `` is the compiled .po file. At first I put the .po and .mo file of a language in the directory `locale/xx_XX/LC_MESSAGES/`. As a result, Launchpad could find the language files, but could not import them.

After some asking around on the #launchpad IRC channel I finally found the solution. As PHP only requires the compiled language files (*.mo) to be in the `locale/xx_XX/LC_MESSAGES/` directory, I moved the template file (getgnulinux.pot) and all language files (*.po) to a directory `locale/getgnulinux/`. I also changed the PHP code so that the language files are named for the appropriate ISO 639 language code. After these changes, translations would still work (PHP still has access to the .mo files) and Launchpad could now import the translation files because all three rules are met.

Leave a Reply

Your email address will not be published. Required fields are marked *