Why doesn't django take my language file into account?

Viewed 6070

I followed the whole documentation about text translation, but django doesn't take my .mo file into account.

Some facts:

  • I created a conf/locale/ folder at the root of my project
  • django.po was generated successfully with django-admin.py makemessages -l fr
  • django.mo was generated successfully with django-admin.py compilemessages

So my folder structure is:

project/
  site/
  locale/
    fr/
      LC_MESSAGES/
        django.mo
        django.po
  • In settings.py, I have set LANGUAGE_CODE = 'fr'
  • My browser correctly sends Accept-Language:fr-FR,fr;
  • request.LANGUAGE_CODE shows fr from my views

But I get nothing translated... How to make django take these files into account ?


Edit

Adding /home/www/project/locale to settings.LOCALE_PATHS works. However, Django should find this path by itself, and I don't like using absolute paths. What happens here ?

1 Answers
Related