Django i18n checklist
i18n not working? Here's a handy checklist to run through:
-
USE_I18N = True
in settings.py? -
USE_L10N = True
in settings.py? -
django.core.context_processors.i18n
is inTEMPLATE_CONTEXT_PROCESSORS
? -
django.middleware.locale.LocaleMiddleware
is inMIDDLEWARE_CLASSES
? - OR - if using django-cms:
cms.middleware.multilingual.MultilingualURLMiddleware
is inMIDDLEWARE_CLASSES
? if using django-cms:
cms.middleware.multilingual.MultilingualURLMiddleware
is right below session middleware?{% load i18n %}
is included in every template using translations? (even templates that inherit from other templates that load that tag must include it){% trans %}
is actually used to translate messages?
Message files (*.po) exist and can be found? Check:
- All
LOCALE_PATHS
insettings.py
- "locale" directory for each of the apps in
INSTALLED_APPS
- Default base translations
Written by HH Veldstra
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#