Skip to content
This repository
Browse code

Defer translating system messages.

Currently, messages are sent using the language of the sender, which
doesn't work well for system messages. We're going to avoid translating
them for now until we can return such messages in the language of the
receiver.
  • Loading branch information...
commit 47549b4bb35ca033b881ce84c66a906d1abf1594 1 parent db7b531
Max Goodman authored October 09, 2012

Showing 1 changed file with 15 additions and 15 deletions. Show diff stats Hide diff stats

  1. 30  r2/r2/lib/system_messages.py
30  r2/r2/lib/system_messages.py
@@ -21,7 +21,7 @@
21 21
 ###############################################################################
22 22
 
23 23
 from pylons import request
24  
-from pylons.i18n import _
  24
+from pylons.i18n import N_
25 25
 
26 26
 from r2.models import Account, Message
27 27
 from r2.lib.db import queries
@@ -30,38 +30,38 @@
30 30
 user_added_messages = {
31 31
     "moderator_invite": {
32 32
         "pm": {
33  
-            "subject": _("invitation to moderate %(url)s"),
34  
-            "msg": _("**gadzooks! you are invited to become a moderator of [%(title)s](%(url)s)!**\n\n"
35  
-                     "*to accept*, visit the [moderators page for %(url)s](%(url)s/about/moderators) and click \"accept\".\n\n"
36  
-                     "*otherwise,* if you did not expect to receive this, you can simply ignore this invitation or report it."),
  33
+            "subject": N_("invitation to moderate %(url)s"),
  34
+            "msg": N_("**gadzooks! you are invited to become a moderator of [%(title)s](%(url)s)!**\n\n"
  35
+                      "*to accept*, visit the [moderators page for %(url)s](%(url)s/about/moderators) and click \"accept\".\n\n"
  36
+                      "*otherwise,* if you did not expect to receive this, you can simply ignore this invitation or report it."),
37 37
         },
38 38
         "modmail": {
39  
-            "subject": _("moderator invited"),
40  
-            "msg": _("%(user)s has been invited by %(author)s to moderate %(url)s."),
  39
+            "subject": N_("moderator invited"),
  40
+            "msg": N_("%(user)s has been invited by %(author)s to moderate %(url)s."),
41 41
         },
42 42
     },
43 43
     "accept_moderator_invite": {
44 44
         "modmail": {
45  
-            "subject": _("moderator added"),
46  
-            "msg": _("%(user)s has accepted an invitation to become moderator of %(url)s."),
  45
+            "subject": N_("moderator added"),
  46
+            "msg": N_("%(user)s has accepted an invitation to become moderator of %(url)s."),
47 47
         },
48 48
     },
49 49
     "contributor": {
50 50
         "pm": {
51  
-            "subject": _("you are an approved submitter"),
52  
-            "msg": _("you have been added as an approved submitter to [%(title)s](%(url)s)."),
  51
+            "subject": N_("you are an approved submitter"),
  52
+            "msg": N_("you have been added as an approved submitter to [%(title)s](%(url)s)."),
53 53
         },
54 54
     },
55 55
     "banned": {
56 56
         "pm": {
57  
-            "subject": _("you've been banned"),
58  
-            "msg": _("you have been banned from posting to [%(title)s](%(url)s)."),
  57
+            "subject": N_("you've been banned"),
  58
+            "msg": N_("you have been banned from posting to [%(title)s](%(url)s)."),
59 59
         },
60 60
     },
61 61
     "traffic": {
62 62
         "pm": {
63  
-            "subject": _("you can view traffic on a promoted link"),
64  
-            "msg": _('you have been added to the list of users able to see [traffic for the sponsored link "%(title)s"](%(traffic_url)s).'),
  63
+            "subject": N_("you can view traffic on a promoted link"),
  64
+            "msg": N_('you have been added to the list of users able to see [traffic for the sponsored link "%(title)s"](%(traffic_url)s).'),
65 65
         },
66 66
     },
67 67
 }

0 notes on commit 47549b4

Please sign in to comment.
Something went wrong with that request. Please try again.