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
).
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With