django, change language settings dynamically
After some failed attempts, I just found how to change the language settings dynamically in django, and I thought it could be useful to someone. Just use function activate() from django.utils.translation. For example:
from django.utils.translation import activate
activate(‘es-ES’)
will change global language settings to ‘es-ES’ (Spain spanish). I use it because I have two forms and I want that errors appear in different languages, but I do not want to get into gettext




February 16th, 2010 10:02
Thanks a lot!
You prob
February 16th, 2010 10:02
Thanks a lot, Fabian!!
You probably saved me a few hours!!!
March 6th, 2010 21:35
Thanks for this blog. I am new at development and this got me straight.
March 7th, 2010 01:25
This is great! Thanks for this blog. I am starting python and this will help a lot.
March 10th, 2010 13:40
For the reason that a Newbie I am incessantly scouring the web on the web to get this type of information .Thank you:P