Hi!
I'm using templetes to generate the HTML body for some reports I send
daily by email. I do it like this:
context = Context()
context["some_var"] = some_value
....
resp = render_to_string("daily_report.html", context)
msg = EmailMultiAlternatives(
_(u'Daily report'), _('Please use a html-emabled mail
reader'),
_('[EMAIL PROTECTED]'), ['[EMAIL PROTECTED]'])
msg.attach_alternative(resp, "text/html")
msg.send()
The template is i18n-ized and is actually created from a page template
that works correctly. But these reports are never translated to the
langauge set in settings.py LANGUAGE_CODE, nor have I found any other
way to control i18n of this template's rendering. I guess this has to
do with me using Context instead of RequestContext. Obviously there is
no request here and thus no RequestContext.
Any ideas how I could control 18n in this scenario?
Regards,
Krešimir Tonković
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---