Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django compilemessages doesn't create .mo files

I'm trying to make my django app available in French (previously it was only available in English). I've marked a few strings in my app for translation, to try it out. I went to the root directory of my app (where manage.py is located) and ran django-admin.py makemessages -l fr_CA. This created a django.po file inside myapp/locale/fr_CA/LC_MESSAGES. I edited that file, providing translations. Heading back to my app's root directory, I ran django-admin.py compilemessages -l fr_CA. The command returned quickly with no output to stdout. No .mo file was created.

Why doesn't this create a .mo file?

I tried setting my LOCALE_PATHS in my settings file, but this had no effect (and besides, I did not need to do that to create the .po files, since they are being located in the default location, path/to/myapp/locale).

like image 438
Edward Newell Avatar asked Mar 01 '15 02:03

Edward Newell


1 Answers

Ok. Figured it out. For some reason, running the compilemessages command in the same place as I ran the makemessages command doesn't work, even though that's what the docs say to do!

I had to go one directory deeper -- the one which contains settings.py not the one that contains manage.py. Weird.

There must be something wrong or weird with how my app is setup, since that goes plainly against what the docs say... but I never changed the structure from the default... Turns out I did.

like image 145
Edward Newell Avatar answered Oct 17 '22 22:10

Edward Newell