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:
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 at 10:02 am
Thanks a lot!
You prob
February 16th, 2010 at 10:02 am
Thanks a lot, Fabian!!
You probably saved me a few hours!!!
March 6th, 2010 at 9:35 pm
Thanks for this blog. I am new at development and this got me straight.
March 7th, 2010 at 1:25 am
This is great! Thanks for this blog. I am starting python and this will help a lot.
March 10th, 2010 at 1:40 pm
For the reason that a Newbie I am incessantly scouring the web on the web to get this type of information .Thank you:P
May 21st, 2010 at 6:40 am
Fabian,
Is there a way to set other Django settings dynamically, specifically I am looking to change the email_host? Thanks