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 | 6 | msgstr "" |
| 7 | 7 | "Project-Id-Version: Django\n" |
| 8 | 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 | 10 | "PO-Revision-Date: 2012-02-14 13:24+0000\n" |
| 11 | 11 | "Last-Translator: Jannis Leidel <jannis@leidel.info>\n" |
| 12 | 12 | "Language-Team: English <en@li.org>\n" |
| ... | ... | @@ -214,6 +214,11 @@ msgstr "comment flag" |
| 214 | 214 | msgid "comment flags" |
| 215 | 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 | 222 | #: templates/comments/approve.html:4 |
| 218 | 223 | msgid "Approve a comment" |
| 219 | 224 | msgstr "Approve a comment" | ... | ... |
| ... | ... | @@ -63,6 +63,7 @@ from django.core.mail import send_mail |
| 63 | 63 | from django.db.models.base import ModelBase |
| 64 | 64 | from django.template import Context, loader |
| 65 | 65 | from django.utils import timezone |
| 66 | +from django.utils.translation import ugettext as _ | |
| 66 | 67 | |
| 67 | 68 | import django_comments |
| 68 | 69 | from django_comments import signals |
| ... | ... | @@ -249,8 +250,10 @@ class CommentModerator(object): |
| 249 | 250 | 'comment': comment, |
| 250 | 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 | 257 | message = t.render(Context(c) if VERSION < (1, 8) else c) |
| 255 | 258 | send_mail(subject, message, settings.DEFAULT_FROM_EMAIL, recipient_list, fail_silently=True) |
| 256 | 259 | ... | ... |
Please
register
or
login
to post a comment