Question

I have recently started working with django internationalization. There is only one view and matching template for which I added translatable strings and made translations for 3 languages.

Now I notice that the django admin language changes in what seems to be random. It changes to more languages than the ones I translated to (english, french and german).

Anyone know what might have caused it?

Was it helpful?

Solution

Seems like this is cause by a weird behaviour of django's translation module.

translation.activate() changes the language for the whole process.

What I had to do is call translation.deactivate() after rendering the template.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top