diff options
Diffstat (limited to 'Mailman')
-rw-r--r-- | Mailman/Bouncer.py | 3 | ||||
-rw-r--r-- | Mailman/Cgi/admin.py | 8 | ||||
-rw-r--r-- | Mailman/Cgi/options.py | 3 | ||||
-rwxr-xr-x | Mailman/ListAdmin.py | 4 | ||||
-rwxr-xr-x | Mailman/MailList.py | 14 | ||||
-rw-r--r-- | Mailman/i18n.py | 5 |
6 files changed, 24 insertions, 13 deletions
diff --git a/Mailman/Bouncer.py b/Mailman/Bouncer.py index 2a1cb539..21a4df38 100644 --- a/Mailman/Bouncer.py +++ b/Mailman/Bouncer.py @@ -49,6 +49,7 @@ REASONS = {MemberAdaptor.BYBOUNCE: _('due to excessive bounces'), } _ = i18n._ +D_ = i18n.D_ @@ -265,7 +266,7 @@ class Bouncer: if info.noticesleft <= 0: # BAW: Remove them now, with a notification message self.ApprovedDeleteMember( - member, 'disabled address', + member, D_('disabled address'), admin_notif=self.bounce_notify_owner_on_removal, userack=1) # Expunge the pending cookie for the user. We throw away the diff --git a/Mailman/Cgi/admin.py b/Mailman/Cgi/admin.py index 174cf34f..984904a7 100644 --- a/Mailman/Cgi/admin.py +++ b/Mailman/Cgi/admin.py @@ -47,6 +47,7 @@ from Mailman.CSRFcheck import csrf_check # Set up i18n _ = i18n._ i18n.set_language(mm_cfg.DEFAULT_SERVER_LANGUAGE) +D_ = i18n.D_ NL = '\n' OPTCOLUMNS = 11 @@ -1484,7 +1485,7 @@ def change_options(mlist, category, subcat, cgidata, doc): else: mlist.ApprovedAddMember(userdesc, send_welcome_msg, send_admin_notif, invitation, - whence='admin mass sub') + whence=D_('admin mass sub')) except Errors.MMAlreadyAMember: subscribe_errors.append((safeentry, _('Already a member'))) except Errors.MMBadEmailError: @@ -1538,7 +1539,7 @@ def change_options(mlist, category, subcat, cgidata, doc): for addr in names: try: mlist.ApprovedDeleteMember( - addr, whence='admin mass unsub', + addr, whence=D_('admin mass unsub'), admin_notif=send_unsub_notifications, userack=userack) unsubscribe_success.append(Utils.websafe(addr)) @@ -1645,7 +1646,8 @@ def change_options(mlist, category, subcat, cgidata, doc): quser = urllib.quote(user) if cgidata.has_key('%s_unsub' % quser): try: - mlist.ApprovedDeleteMember(user, whence='member mgt page') + mlist.ApprovedDeleteMember(user, + whence=D_('member mgt page')) removes.append(user) except Errors.NotAMemberError: errors.append((user, _('Not subscribed'))) diff --git a/Mailman/Cgi/options.py b/Mailman/Cgi/options.py index 4f128baf..d563d253 100644 --- a/Mailman/Cgi/options.py +++ b/Mailman/Cgi/options.py @@ -45,6 +45,7 @@ DIGRE = re.compile( # Set up i18n _ = i18n._ i18n.set_language(mm_cfg.DEFAULT_SERVER_LANGUAGE) +D_ = i18n.D_ try: True, False @@ -583,7 +584,7 @@ address. Upon confirmation, any other mailing list containing the address try: try: mlist.DeleteMember( - user, 'via the member options page', userack=1) + user, D_('via the member options page'), userack=1) except Errors.MMNeedApproval: needapproval = True except Errors.NotAMemberError: diff --git a/Mailman/ListAdmin.py b/Mailman/ListAdmin.py index 877aa5c4..d083a521 100755 --- a/Mailman/ListAdmin.py +++ b/Mailman/ListAdmin.py @@ -45,6 +45,7 @@ from Mailman.Logging.Syslog import syslog from Mailman import i18n _ = i18n._ +D_ = i18n.D_ # Request types requiring admin approval IGN = 0 @@ -436,7 +437,8 @@ class ListAdmin: assert value == mm_cfg.SUBSCRIBE try: userdesc = UserDesc(addr, fullname, password, digest, lang) - self.ApprovedAddMember(userdesc, whence='via admin approval') + self.ApprovedAddMember(userdesc, + whence=D_('via admin approval')) except Errors.MMAlreadyAMember: # User has already been subscribed, after sending the request pass diff --git a/Mailman/MailList.py b/Mailman/MailList.py index abc46abd..3e5a6232 100755 --- a/Mailman/MailList.py +++ b/Mailman/MailList.py @@ -72,6 +72,7 @@ from Mailman import i18n from Mailman.Logging.Syslog import syslog _ = i18n._ +D_ = i18n.D_ EMPTYSTRING = '' OR = '|' @@ -1071,6 +1072,7 @@ class MailList(HTMLFormatter, Deliverer, ListAdmin, otrans = i18n.get_translation() i18n.set_language(lang) try: + whence = "" if whence is None else "(" + _(whence) + ")" realname = self.real_name subject = _('%(realname)s subscription notification') finally: @@ -1081,7 +1083,7 @@ class MailList(HTMLFormatter, Deliverer, ListAdmin, "adminsubscribeack.txt", {"listname" : realname, "member" : formataddr((name, email)), - "whence" : "" if whence is None else "(" + whence + ")" + "whence" : whence }, mlist=self) msg = Message.OwnerNotification(self, subject, text) msg.send(self) @@ -1118,7 +1120,7 @@ class MailList(HTMLFormatter, Deliverer, ListAdmin, 'adminunsubscribeack.txt', {'member' : name, 'listname': self.real_name, - "whence" : "" if whence is None else "(" + whence + ")" + "whence" : "" if whence is None else "(" + _(whence) + ")" }, mlist=self) msg = Message.OwnerNotification(self, subject, text) msg.send(self) @@ -1307,7 +1309,7 @@ class MailList(HTMLFormatter, Deliverer, ListAdmin, except ValueError: raise Errors.MMBadConfirmation, 'op-less data %s' % (rec,) if op == Pending.SUBSCRIPTION: - whence = 'via email confirmation' + whence = D_('via email confirmation') try: userdesc = data[0] # If confirmation comes from the web, context should be a @@ -1316,7 +1318,7 @@ class MailList(HTMLFormatter, Deliverer, ListAdmin, # context is a Message and isn't relevant, so ignore it. if isinstance(context, UserDesc): userdesc += context - whence = 'via web confirmation' + whence = D_('via web confirmation') addr = userdesc.address fullname = userdesc.fullname password = userdesc.password @@ -1348,9 +1350,9 @@ class MailList(HTMLFormatter, Deliverer, ListAdmin, addr = data[0] # Log file messages don't need to be i18n'd if isinstance(context, Message.Message): - whence = 'email confirmation' + whence = D_('email confirmation') else: - whence = 'web confirmation' + whence = D_('web confirmation') # Can raise NotAMemberError if they unsub'd via other means self.ApprovedDeleteMember(addr, whence=whence) return op, addr diff --git a/Mailman/i18n.py b/Mailman/i18n.py index 605d4e76..f39b1004 100644 --- a/Mailman/i18n.py +++ b/Mailman/i18n.py @@ -123,7 +123,10 @@ else: def C_(s): return tolocale(_(s, 2)) - +# marking for pygettext +def D_(s): + return s + def ctime(date): # Don't make these module globals since we have to do runtime translation |