Importing your project's translations
Just as with translation templates, you can import translation files (.po) in two ways:
- from your series' default Bazaar branch
- or by uploading a tarball of templates and translation files through the web interface.
If you already have your translation files in a Bazaar branch (or git branch, or CVS or Subversion repository), you may find that to be the easiest source for importing your translation files.
Imports from a Bazaar branch
You can make either one-off or continuous imports of translation files in a Bazaar branch. Which you choose will most likely depend on whether you expect to make frequent translations outside of Launchpad.
Continuous: on your project's translations settings page choose Import template and translation files to automatically import any .po that are in the branch, whenever Launchpad imports .pot files from the branch.
One off: go to the Request Bazaar Import page to request a one-time import of all .pot and .po files in the branch.
One time upload of a tarball
Visit your project's translations overview page and click the link for the trunk series. Upload a tarball containing your translation files preserving directory structure.
Naming translation files
To ensure automatic approval and subsequent import of the translation files, you need to follow the translations import policy.
As a rough guide, you should observe these two rules:
- Place each PO file in the same directory as the template it translates. Remember that each template should have its own directory.
Name the files according to the language code of the language they contain. So for Spanish translations use es.po.
Avoiding common problems
Your translations stand a better chance of an automatic, and therefore near instant, import if you follow these guidelines/
- Ensure consistent formatting: for example, if "%d" appears in an original English string, make sure it's also in each language's equivalent.
- Use consistent paths within your tarball: locate all your .po translation files under the same directory structure.
Name individual language .po files using the ISO language code, such fr.po for French. Only append the country code in the following circumstances:
variants of international English: for example, en_GB.po
Brazillian Portuguese: pt_BR.po (Brazillian Portuguese), as opposed to pt.po for European Portuguese
Chinese: traditional zh_TW.po and simplified zh_CN.po
How Launchpad prioritises imported translation strings
To help ensure the best quality translations end-up in Ubuntu, Launchpad prioritises translation strings differently depending on where they were made.
In general, a translation made in Launchpad will take precedence over a translation imported from upstream, meaning that most imports will only overwrite a string if it also was an import.
There are, though, two important exceptions:
- The first time that the translation of a string, in a particular language, is imported into Launchpad, it will take precedence over any existing translation made in that language in Launchpad.
- If an imported string matches the translation already made in Launchpad. This means that the translation will now be overwritten by any subsequent imports, if they differ. However, making a change to the translation in Launchpad would reset it to take precedence over imported strings.
Launchpad can help you safeguard the quality of the translations you use in your project. Choose a review policy for your project's translations.