I have seen more than one hundred posts about i18n issues and no solution seems to solve my problem.
I have an app running with Django 1.3.1 and it works Fine at my develop machine. But when I bring to heroku nothing happens. The files are not translated at all. It seems that the locale folder in my project is not being found.
Locale folder is at my project level and this is my settings:
BASE_PATH = os.path.dirname(os.path.abspath(__file__))
LANGUAGE_CODE = 'pt-br'
USE_I18N = True
USE_L10N = True
ugettext = lambda s: s
LANGUAGES = (
('en-us', ugettext('English')),
('pt-br', ugettext('Portuguese')),
)
LOCALE_PATHS = (
os.path.join(BASE_PATH, "locale"),
)
Locale folder follows this structure:
locale
pt_BR
LC_MESAGES
django.mo
django.po
In the sample above you wrote
LC_MESAGESinstead ofLC_MESSAGES(notice the double S), I believe this very well could be your issue.If not then read on!
I had this issue (again!) recently, and the answer was found in this part of the django documentation
I suspect you have the same issue since your “admin” app was translated but not your own (project) app.
It seems that Django is looking for your translations like so:
With the settings you described above, you must make sure your tree looks something like this (with the most important being settings.py is in the dir above the ‘locale’ dir):