is it intentional that rosetta changes the filenames for uploaded translation files?

Asked by zzz on 2009-01-26

When enabling launchpad translations for our project, I uploaded a tar containing our .pot file and a couple of already translated languages.


These have now been imported and translation is possible through the launchpad web UI.

As an experiment I performed the en_GB translation, and then downloaded all translations from rosetta.

This downloaded package has the following structure and filenames:

It seems rosetta has prepended gwibber- to all the translations, and is storing the imported files in a gwibber subdirectory, whilst those created entirely through launchpad are place in the root folder.

Firstly, is it intentional that rosetta prepends the .pot template name to all translated files? (it doesn't seem to mention this in the documentation). Secondly, why are imported files in a different subdirectory to rosetta-created ones? Is this second thing a bug?

Many thanks.

Question information

English Edit question
Launchpad itself Edit question
Henning Eggers Edit question
Solved by:
Last query:
Last reply:
Henning Eggers (henninge) said : #1

It is intentional that pofiles named only like the language code are renamed to contain the translation domain, too.
It is also intentional to place files that where uploaded without a directory into one (named like the translation domain) when exporting them in a tarball.

It is a bug that names of pofiles created in Launchpad are prepended with a / if the potemplate (as in your case) did not have a directory. Because of that it is not included in the directory.

You can fix this the following way: Put the files in a tarball with the following structure:

and upload it. The path names for the files will be updated. When you now create new pofiles in the UI they will go in the same directory as the template. Upon download you will get a tarball of the same structure you got now (po files renamed to <domain>-<langcode>.po) but all files included in the directory.

I have yet to determine if the renaming of files in a directory is there for a good reason or if that is a bug, too.


Thanks for the explanation. I have queued up an import with all files under gwibber/ as you suggested and will let you know if this solves the problem once it has completed.

Celso Providelo (cprov) said : #3


Thanks for helping Dominic, I'm assigning it to you and marking it as answered.

Some further discussion for this question.

Firstly, the renaming of po files to <domain>-<langcode>.po makes rosetta exports incompatible by default with python distutils_extra.command.build_i18n which expects all files to be <langcode>.po and knows the domain already from the .pot template filename. If fed rosetta .po files directly it will try and install locales in /usr/share/locale/<domain>-<langcode>/LC_MESSAGES/<domain>.mo instead of /usr/share/locale/<langcode>/LC_MESSAGES/<domain>.mo

Obviously its not too difficult to do a quick sed -e 's/<domain>-//' on the filenames but is this problem then a bug with the distutils_extra package or rosetta?

Secondly, despite a re-upload of all languages and template with a gwibber subdirectory, I'm still seeing the same problem that exports of newly created (in rosetta) languages are left in a root folder below the gwibber subdir. Shall I raise this as a separate bug?

$ wget
$ aunpack launchpad-export.tar.gz
tar: Removing leading `/' from member names

Henning Eggers (henninge) said : #5

We discussed the naming of exported po files and figured the reason this is done is to avoid file name clashes if there are multiple templates in the same directory. So, for this reason, it is a feature but we are aware that it plays poorly with gettext tools. I just found a bug concerning this:

As I said, the placing of new files outside the directory is bug 321459 which I just submitted a fix for. Unfortunately it is too late for this fix to be included in this month's release (2.2.1) which is due today. You will have it on sometime next week.

As you can see, gwibber-en_GB.po is now in the directory, after you re-uploaded it. This is the best Launchpad can do at the moment, I am afraid.

Ah, excellent.

Thanks for the clarification! :-)