I'm rendering a template with a management command (something I need for producing documentation in my native language). So I've no request object, so no RequestContext. Is there a way I can force the template rendering process to lookup translation strings from a particular language other than English?
views:
11answers:
2
A:
You could try setting settings.LANGUAGE_CODE
directly in your management command.
Daniel Roseman
2010-06-10 10:49:01
No I didn't, but activating the translation for the language worked.
Vasil
2010-06-10 15:07:47
A:
In case someone else needs something like this. You need to do the following before rendering the template:
from django.utils import translation
translation.activate(cur_language)
where cur_language is the language code for the language you want.
Vasil
2010-06-10 15:09:34