Django i18n checklist
i18n not working? Here's a handy checklist to run through:
-
USE_I18N = Truein settings.py? -
USE_L10N = Truein settings.py? -
django.core.context_processors.i18nis inTEMPLATE_CONTEXT_PROCESSORS? -
django.middleware.locale.LocaleMiddlewareis inMIDDLEWARE_CLASSES? - OR - if using django-cms:
cms.middleware.multilingual.MultilingualURLMiddlewareis inMIDDLEWARE_CLASSES? if using django-cms:
cms.middleware.multilingual.MultilingualURLMiddlewareis 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_PATHSinsettings.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#