Answer the question
In order to leave comments, you need to log in
How to set up multilingualism on the site?
settings.py:
LANGUAGE_CODE = 'kz'
USE_I18N = True
USE_L10N = True
ugettext = lambda s: s
LANGUAGES = [
('en', ugettext('English')),
]
urlpatterns += i18n_patterns(
url(r'^$', "home.views.home", name="home"),
)
.....
File "/usr/lib/python3.5/gettext.py", line 432, in translation
raise OSError(ENOENT, 'No translation file found for domain', domain)
FileNotFoundError: [Errno 2] No translation file found for domain: 'django'
Answer the question
In order to leave comments, you need to log in
Eh, I spent 2 days on an elementary thing, resentment ((.
the essence of the problem was this, in projects/locale/kz/LC_MESSAGES there is a django.po file
inside it is "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\ n" should have spotted it on "Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<12 || n%100>14) ?1 : n%10==0 || (n%10>=5 && n%10<=9) || (n"
"%100> =11 && n%100<=14)? 2 : 3);\n"
followed by
python3.5 manage.py compilemessages
django-admin.py compilemessages
And we read How Django discovers language preference more carefully , everything is described there in as much detail as possible.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question