Commit 60ffd86c42e7b43a496d6149254f1ae5adf22b6e
1 parent
e4e208b9
Made moderation mail subject translatable
Fixes #68. Thanks dlancer for the report.
Showing
2 changed files
with
11 additions
and
3 deletions
| @@ -6,7 +6,7 @@ msgid "" | @@ -6,7 +6,7 @@ msgid "" | ||
| 6 | msgstr "" | 6 | msgstr "" |
| 7 | "Project-Id-Version: Django\n" | 7 | "Project-Id-Version: Django\n" |
| 8 | "Report-Msgid-Bugs-To: \n" | 8 | "Report-Msgid-Bugs-To: \n" |
| 9 | -"POT-Creation-Date: 2015-06-22 17:28+0200\n" | 9 | +"POT-Creation-Date: 2016-02-10 09:06+0100\n" |
| 10 | "PO-Revision-Date: 2012-02-14 13:24+0000\n" | 10 | "PO-Revision-Date: 2012-02-14 13:24+0000\n" |
| 11 | "Last-Translator: Jannis Leidel <jannis@leidel.info>\n" | 11 | "Last-Translator: Jannis Leidel <jannis@leidel.info>\n" |
| 12 | "Language-Team: English <en@li.org>\n" | 12 | "Language-Team: English <en@li.org>\n" |
| @@ -214,6 +214,11 @@ msgstr "comment flag" | @@ -214,6 +214,11 @@ msgstr "comment flag" | ||
| 214 | msgid "comment flags" | 214 | msgid "comment flags" |
| 215 | msgstr "comment flags" | 215 | msgstr "comment flags" |
| 216 | 216 | ||
| 217 | +#: moderation.py:253 | ||
| 218 | +#, python-format | ||
| 219 | +msgid "[%(site)s] New comment posted on \"%(object)s\"" | ||
| 220 | +msgstr "" | ||
| 221 | + | ||
| 217 | #: templates/comments/approve.html:4 | 222 | #: templates/comments/approve.html:4 |
| 218 | msgid "Approve a comment" | 223 | msgid "Approve a comment" |
| 219 | msgstr "Approve a comment" | 224 | msgstr "Approve a comment" |
| @@ -63,6 +63,7 @@ from django.core.mail import send_mail | @@ -63,6 +63,7 @@ from django.core.mail import send_mail | ||
| 63 | from django.db.models.base import ModelBase | 63 | from django.db.models.base import ModelBase |
| 64 | from django.template import Context, loader | 64 | from django.template import Context, loader |
| 65 | from django.utils import timezone | 65 | from django.utils import timezone |
| 66 | +from django.utils.translation import ugettext as _ | ||
| 66 | 67 | ||
| 67 | import django_comments | 68 | import django_comments |
| 68 | from django_comments import signals | 69 | from django_comments import signals |
| @@ -249,8 +250,10 @@ class CommentModerator(object): | @@ -249,8 +250,10 @@ class CommentModerator(object): | ||
| 249 | 'comment': comment, | 250 | 'comment': comment, |
| 250 | 'content_object': content_object, | 251 | 'content_object': content_object, |
| 251 | } | 252 | } |
| 252 | - subject = '[%s] New comment posted on "%s"' % (get_current_site(request).name, | ||
| 253 | - content_object) | 253 | + subject = _('[%(site)s] New comment posted on "%(object)s"') % { |
| 254 | + 'site': get_current_site(request).name, | ||
| 255 | + 'object': content_object, | ||
| 256 | + } | ||
| 254 | message = t.render(Context(c) if VERSION < (1, 8) else c) | 257 | message = t.render(Context(c) if VERSION < (1, 8) else c) |
| 255 | send_mail(subject, message, settings.DEFAULT_FROM_EMAIL, recipient_list, fail_silently=True) | 258 | send_mail(subject, message, settings.DEFAULT_FROM_EMAIL, recipient_list, fail_silently=True) |
| 256 | 259 |
Please
register
or
login
to post a comment