Permalink
Browse files

fixed bug where the context variables don't get translated to the lan…

…guage of the recipient, e.g. resulting in wrong translations of the email subject

git-svn-id: https://django-notification.googlecode.com/svn/trunk@89 590c3fc9-4838-0410-bb95-17a0c9b37ca9
  • Loading branch information...
1 parent 959697b commit 1310e11793aed553b392e6ed41c42a06deea7c77 @jezdez jezdez committed Aug 1, 2008
Showing with 8 additions and 7 deletions.
  1. +8 −7 notification/models.py
View
15 notification/models.py
@@ -202,13 +202,6 @@ def send(recipient, label, extra_context={}, issue_notice=True):
reverse("notification_notices"),
)
- context = Context({
- "notice": ugettext(notice_type.display),
- "notices_url": notices_url,
- "current_site": current_site,
- })
- context.update(extra_context)
-
current_language = get_language()
formats = (
@@ -234,6 +227,14 @@ def send(recipient, label, extra_context={}, issue_notice=True):
# activate the user's language
activate(language)
+ # update context with user specific translations
+ context = Context({
+ "notice": ugettext(notice_type.display),
+ "notices_url": notices_url,
+ "current_site": current_site,
+ })
+ context.update(extra_context)
+
# get prerendered format messages
messages = get_formatted_messages(formats, label, context)

0 comments on commit 1310e11

Please sign in to comment.