django-multilingual and switching between languages on template side

14,045

Solution 1

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

Solution 2

You might also want to try django-localeurl app. It enables users to switch locales storing current locale in the URL. It also provides several useful template tags for switching and displaying available locales.

Share:
14,045
israkir
Author by

israkir

Without music, life would be a mistake...

Updated on June 17, 2022

Comments

  • israkir
    israkir almost 2 years

    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?