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?

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top