I started translating OSQA for French, and experimented my work with ./manage.py compilemessages. I worked fine, but after a hundred lines, I noticed some words and lines, although translated in the po and compiled, were still appearing in English. After some search, I discovered the po files actually in the SVN repository were not generated with the latest source code.

Therefore, I ran ./manage.py makemessages to update the po files that would actually match the source code. I discovered that it created a complete mess in my po file. Some of the translated lines do not correspond anymore to the English line. I am feeling very disappointed, just like I lost a couple of hours for nothing.

Is there any recipe to avoid such annoyance?

I got a version of my po file before regenerating th po. Do you feel like adding it to the repository (only 100 line translated)?

asked 15 Sep '10, 19:04

Didier%20Trosset's gravatar image

Didier Trosset
accept rate: 0%

Hi Didier,

I ran into similar problems when I started translating OSQA into German. I think I worked out a translation recipe that Works For Me. If you find out about better ways to do it, please share!


  • SVN Checkout of OSQA
  • Babel, a Python-centric translation software
  • BabelDjango, Django plugin for the above
  • PoEdit, a graphical, multi-platform translation file editor (killer features: automatic translation and update from POT file)


(See here and here)

  1. Create a directory (not under the SVN checkout) to put your translation file and Babel settings into (mylocale, say).
  2. Copy this into a file called babel.cfg in your mylocale folder:
    [python: **.py]
    [django: **/templates/**.*]
  3. Make sure you are in the mylocale directory, then create the translation template django.pot by running
    pybabel extract -F babel.cfg -o django.pot path-of-your-svn-checkout
  4. Start PoEdit and create a new catalog from the template (File > New catalog from POT file...).
  5. Fill in the catalog details under the Project info tab. Language is necessary, Country should probably be left empty. There is no need to fill in anything under Paths or Keywords. Save the file as django-languagecode.po, e.g. django-de.po.
  6. Check out the PoEdit Help (Help > Contents... > Translation Memory) for instructions to set up the automatic translation.

But what if there's an update?

No prob:

  • Your own translation is not in the SVN tree, and will therefore not be overwritten when you svn up.
  • Simply recreate the django.pot file (Step 3 above), then update your .po file using PoEdit: Catalog > Update from POT file...


Use a version control system for your translation files. That way, even if you accidentally overwrite it, you can just revert to your old version and be happy.


answered 31 Jul '11, 09:47

curiousleo's gravatar image

accept rate: 0%

edited 31 Jul '11, 10:07

Regarding recipes, Google Translator Toolkit just added support for PO files. You upload eg the OSQA English PO file and it can give you a head start on your translation. I just tried it for a Swedish translation and it works quite well.

It didn't translate the fuzzy messages and I wanted those as well so I just removed the fuzzy markers first. There were also some minor issues with the formatting of the new PO file but maybe we can gather workarounds for those in comments to this thread. Most issues were related to Python and HTML formatting and some may also be reported and fixed by Google.


answered 10 Apr '12, 06:58

wwwclaes's gravatar image

accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 15 Sep '10, 19:04

Seen: 2,149 times

Last updated: 10 Apr '12, 06:58

powered by OSQA