I work on a Django project where the default language is french. I also want to support english.
The internationalisation works as I expected in python code and template code :
- when the language requested is french (there is /fr/ in the url), the text displayed is the one from my code (in my case french), even if there is a translation in locale/en/LC_MESSAGES/django.po (that has been compilated into django.mo).
- when the language requested is english (there is /en/ in the url)
- if there is a translation in locale/en/LC_MESSAGES/django.po, this translation is displayed
- if not, the "default" text from my code is displayed
So it seems I don't need to create and compile the message file for my base language (right?).
In the javascript files it does not work the same : it displays the translation from locale/en/LC_MESSAGES/django.po whenever there is one, even when the language requested is french.
After reading this thread, I ran the commands:
django-admin makemessages -d djangojs -l fr
django-admin compilemessages
But I still get the english translation, unless I fill in the msgstr in locale/fr/LC_MESSAGES/djangojs.po.
Do I have to fill in the msgstr for my base language (so basically copy/paste the msgid) for every text of my site?
That seems very tedious.