Thanks for the help. On Thu, Jun 10, 2010 at 12:49 PM, Tom Evans <tevans...@googlemail.com> wrote: > On Thu, Jun 10, 2010 at 11:39 AM, Vasil Vangelovski > <vvangelov...@gmail.com> wrote: >> 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? >> > > Sure, just activate the language you wish to have displayed: > > This is some code I use to send admin initiated emails to users in > their selected native language: > > from django.utils import translation > > if settings.DISPLAY_I18N: > cur_language = translation.get_language() > if not language: > if user is not None: > language = user.get_profile().language > else: > language = 'en' > translation.activate(language) > > text_body, html_body, subject = .... > > if settings.DISPLAY_I18N: > translation.activate(cur_language) > return text_body, html_body, subject > > > Cheers > > Tom > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-us...@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > >
-- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.