Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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...
commit 1310e11793aed553b392e6ed41c42a06deea7c77 1 parent 959697b
@jezdez jezdez authored
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)
Please sign in to comment.
Something went wrong with that request. Please try again.