pythondjangodjango-i18ndjango-multilinguali18n-switcher

django-multilingual and switching between languages on template side


I'm 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?


Solution

  • 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