Search code examples
pythondjangodjango-i18n

How can I change Django admin language?


I have a django 1.6 site with i18n working. I can change the frontend language with a select box in the top of the template, but I don't know if there is a django app or trick to change the admin language, because it seems to store somewhere in session variable, and it keeps the first language I have used in the frontend.


Solution

  • You can create /en/admin, /fr/admin/ and so on using i18n_patterns:

    urlpatterns += i18n_patterns(
        url(r'^admin/', include(admin.site.urls)),
    )
    

    (For Django <= 1.7, you must specify a prefix, use i18n_patterns('', ... ))