Verifying translation uploads
This information is intended to help package maintainers to optimize their packages, so that translation related files get automatically imported into Launchpad.
Testing the package locally
To test if your package conforms to the requirements of the import script in Launchpad, please do the following:
In /etc/pkgbinarymangler/striptranslations.conf set enable: to true
Optionally, install any build dependencies: sudo apt-get build-dep $PKGNAME
Build the package with debuild -uc -us -b
You will find a <pkgname>-translations.tar.gz tarball along with the .deb package(s)
- Untar that tarball into a temporary directory
- Compare if the directory structure and the .pot and .po files conform to the requirements listed below
If the application uses gettext, like most GTK and GNU applications do:
Translation filenames: the actual translations (.po files) must have a filename of the format $LANGUAGECODE.po or $LOCALECODE.po (e.g. de.po, pt_BR.po, zh_TW.po)
Template and translations location: all translation-related files (the .pot template and its corresponding .po templates) must end up in the same (sub-)directory if possible.
Multiple domains: if the application has multiple translation domains (i.e. multiple .pot files), each .pot file and their corresponding .po files should end up in a separate subdirectory (e.g. po/nautilus/nautilus.pot and po/libnautilus/libnautilus.pot)
Recommended translations layout: it is recommended that templates and translations for the main application or library are located in the po/ directory.
Recommended help layout: it is recommended that templates and translations for help files are located in the help/po/ directory. Note: they will be ignored by Launchpad, since we currently have no infrastructure to deal with them properly.
Recommended documentation layout: it is recommended that templates and translations for documentation files are located in the doc/po/ directory. Note: they will also be ignored by Launchpad for the same reason as the help translations.
Obsolete translations: if there are .po files present in the package but no associated .pot template, please remove them, since they cannot be used without a .pot template. There might be a bug in the package or in the source code whereby the .pot file doesn't get generated, so make sure to double-check that as well.
Valid POT template: please check if the .pot file has any meaningful content. Empty .pot files should be removed and the package build rules be fixed.
Templates generated by patches: if your package contains patches and those patches result into extra templates, like patches.pot, please merge those changes into the main template, as we have no use for patch .pot files. Such .pot files should not exist in the final tarball.
Multiple templates merged into one: if the package generates multiple .pot files and later merges them into one, only the final .pot file should be present in the final tarball.
Architecture-dependent templates: if the package creates the same .pot file in architecture-dependent subdirectories, please consider to merge them, as we can only deal with one single .pot per translation domain.
Test templates: test routines and test files should not generate any .pot template or ship any .po file. If such files are present, please remove them.
Use UTF-8 encoding: if you have multiple .po files for a language, each in a different encoding, please consider renaming the ones encoded in UTF-8 to be the main .po file for that language and discard the other ones. They might be interesting for Windows users, but not for Linux ones, since translations get converted with iconv into the encoding the user is runnning anyway. And nowadays UTF-8 is the default encoding on Linux. E.g.: if you have zh_TW.po (Big5 encoding), zh_TW.UTF-8.po and zh_TW.cp960.po, please remove zh_TW.po and zh_TW.cp960.po and rename zh_TW.UTF-8.po to zh_TW.po.
Obsolete no locale: the no locale is obsolete. If you find no.po files, please look into it and find out if it's Norwegian Bokmål or Nynorsk. Usually it's Bokmål. Please rename the file to the proper language code: nb.po for Bokmål, nn.po for Nynorsk. If nb.po and nn.po are already present, remove no.po.
English US translations: If you have an en_US.po file, please investigate if it really contains translations (i.e. if the source code uses en_GB or another language) and if not, you can safely discard it.