Translating Django applications using Launchpad

One of my Django-based projects, Libravatar, makes use of Launchpad's interface to keep its translations current. Unfortunately, the PO file layout that Django insists on using isn't directly compatible with the one that Launchpad needs in order to setup automatic import of translations on a branch.

The solution I found is to use the mandatory Launchpad layout and then create symlinks in the right places for Django.

Here is where the Libravatar PO files are located in the bzr repository:

po/libravatar/de.po  
po/libravatar/fr.po  
po/libravatar/libravatar.pot

and here are the (relative) symbolic links:

libravatar/locale/de/LC_MESSAGES/django.po  
  -> ../../../../po/libravatar/de.po  
libravatar/locale/en/LC_MESSAGES/django.po  
  -> ../../../../po/libravatar/libravatar.pot  
libravatar/locale/fr/LC_MESSAGES/django.po  
  -> ../../../../po/libravatar/fr.po

Note that the "en" localization is left untranslated and used as the translation template (POT file).