django-multilingual and switching between languages on template side

israkir picture israkir · Sep 22, 2009 · Viewed 14.1k times · Source

I am trying to use django-multilingual and setup it properly. But what I found is that everything is clear for django-multilingual except a template usage example.

I just started to use django and I don't know, maybe because of this reason, I cannot figure out how to switch between languages on template side.

Is there any example that you can give or any 'more' clear source/documentation about this?

Answer

zalew picture zalew · Sep 22, 2009

switching locale in django is a simple post do this view

https://docs.djangoproject.com/en/dev/topics/i18n/translation/#the-set-language-redirect-view

in templates you can access the language value with request.LANGUAGE_CODE