9
For those of you having the same issue, the solution I found is to create the locale folder with an underscore and a capital H.
So it would look like:
django-admin makemessages -l zh_Hans
The reason is that the Django documentation states:
In all cases the name of the directory containing the translation is
expected to be named using locale name notation. E.g. de, pt_BR,
es_AR, etc.
and in another part of the documentation says:
A locale name, either a language specification of the form ll or a
combined language and country specification of the form ll_CC.
Examples: it, de_AT, es, pt_BR. The language part is always in lower
case and the country part in upper case. The separator is an
underscore.
0
Is your chinesse locale directory named ‘zh_hans’ instead of ‘zh-hans’? I believe the directory must have underscore instead of dash.
- [Django]-I am facing to start runserver django?
- [Django]-How do I include an external CSS file as a rule for a class inside a .scss file?
- [Django]-Python Piston equivalent for consuming RESTful APIs?
- [Django]-Test failures ("no transaction is active") with Ghost.py
- [Django]-Why can't Django REST Framework's HyperlinkedModelSerializer form URL?
0
This issue indeed confused me a lot!
Here’s a short summary base on ALUW’s answer:
# in settings.py, use lower-case language code, The separator is a dash.
LOCALE_PATHS = (os.path.join(BASE_DIR, 'locale'), )
LANGUAGES = (
('en', _('English')),
#Simplified Chinese
('zh-hans', _('Simplified Chinese')),
)
# while when making and compiling message file, use local name.
# The language part is always in lower case and the country part in upper case.
# The separator is an underscore.
./manage.py makemessages -l zh_Hans
- [Django]-How can I include user profile's images/logos on django comments
- [Django]-How to display a form filed with size and maxlength attributes in Django?
- [Django]-Django log file permissions with uwsgi
- [Django]-Django Try Except Not Working
- [Django]-Redirect all requests for www. to root domain