diff --git a/CHANGELOG b/CHANGELOG index b208c928..600a9ff4 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -9,3 +9,7 @@ to the Submitter. This is a work in progress. Patch courtesy of david@zettazebra.com, adds the ability to add tags to tickets if django-tagging is installed and in use. If django-tagging isn't being used, no change is visible to the user. + +2009-10-13 r141 Issue #118 Incorrect locale handling on email templates +Patch courtesy of hgeerts. Corrects the handling of locale on email +templaets, defaulting to English if no locale is provided. diff --git a/lib.py b/lib.py index 39e2ee15..2e43c0a6 100644 --- a/lib.py +++ b/lib.py @@ -52,7 +52,9 @@ def send_templated_mail(template_name, email_context, recipients, sender=None, b import os context = Context(email_context) - locale = getattr(context['queue'], 'locale', 'en') + locale = getattr(context['queue'], 'locale', '') + if not locale: + locale = 'en' if locale: template_localized = template_name + ':' + locale