Last Updated: February 25, 2016
·
791
· hassy

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 in TEMPLATE_CONTEXT_PROCESSORS?
  • django.middleware.locale.LocaleMiddleware is in MIDDLEWARE_CLASSES?
  • OR - if using django-cms: cms.middleware.multilingual.MultilingualURLMiddleware is in MIDDLEWARE_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 in settings.py
  • "locale" directory for each of the apps in INSTALLED_APPS
  • Default base translations