views:

130

answers:

1

Django internationalization allows me to set a language code either in settings file (site-wide) or on per-user / per-session basis.

How can I change language for a particular page?

I wrote a middleware that sets request.LANGUAGE_CODE the way I want it to be translated, but nothing seems to use this attribute to do the selected translation.

+3  A: 

Great, I have found an answer here: http://fseoane.net/blog/2009/django-change-language-settings-dynamically

Here is how can change the Django language dynamically

from django.utils.translation import activate

activate(‘es-ES’)
Yury Lifshits