i18n Example

A companion project to my blog post about i18n:

To work through this example first clone the project.

The setup is pretty standard, assuming you have created a virtualenv

pip install -r requirements.txt
python syncdb
python runserver

You will now see the untranslated main page, no matter what language code you provide.

The project has already been setup to use translations, and has some strings already marked for translation.

Now you can follow the instructions in the blog post to create a german translation is fake translastions to help you determine coverage.

mkdir locale
python makemessages -l de locale/de/LC_MESSAGES/django.po
python compilemessages
python runserver

Now you should be able to see fake translations at You can also checkout the builtin translations to the admin,


A few things are already done for you but you should be aware of them:

  • LOCALE_PATH was set in
  • i18n_patterns was used in
  • ugettext was imported and used in
  • {% load i18n %} and the {% trans 'foo' %} templates tags were used in base.html and home.html