BLOG

A LITTLE STORY ABOUT MY JOURNEY

Django translation in URLs and locale switching

Adding locale switcher to templates Django comes with a view, django.views.i18n.set_language(), that sets a user’s language preference and redirects back to the previous page. This view ca be activated by adding URL like (r’^i18n/’, include(‘django.conf.urls.i18n’)), to urlconf (see Below example). In order to add locale switcher to your templates you will have to add a […]