Задать вопрос

Тел: +7 965 3737 888

503

Просмотров

1

Ответов

language switcher in admin

you have a multilingual site and need to change languages in admin. Previously this was easy in the site itself and more difficult in admin. Now it is dead easy. Set up your languages in settings.py. Make a directory called 'admin' in your templates directory, copy ~/django/contrib/admin/templates/base.html to that directory. Add the following code (below breadcrumbs is a good place)

this will give you a switcher for all installed languages. You would need to refresh the browser on changing the language.

Вопрос полезен? Да0/Нет0
file_4295.html(434.0б)
None

Ответы (1):

Ответsimon_w:29.11.2010
Ответ полезен? Да0/Нет0

This wouldn't work for me (Django 1.2.3) without adding 'django.middleware.locale.LocaleMiddleware', to MIDDLEWARE_CLASSES