This is the first time I used Django localization.
- I generated the .po files with makemessages and randomly select a few strings to fill in the translations, just to check if localization works.
- Then I generate the .mo file with compilemessages.
- I go to the web page and only see a string 'Username' translated, most other strings don't get the translated version displayed.
What is going on here?
EDIT: I found out why 'Username' is translated, it used the default translation in Django, but why Django didn't use my mo file is beyond me. I followed all the instructions in i18n doc.
- I set the LOCALE_PATHS variable in settings.py to the path for my localization files.
- I tried different LANGUAGE_CODE settings 'zh-cn', 'zh_CN'(both the setting variable and the directory name).
- I tried
msgunfmt django.mo
, the file is valid.
There are some lines close to the beginning of po file:
#, fuzzy
msgid ""
msgstr ""
I believe this is normal.