diff options
Diffstat (limited to 'Mailman')
-rw-r--r-- | Mailman/Bouncer.py | 8 | ||||
-rw-r--r-- | Mailman/Cgi/admin.py | 19 | ||||
-rw-r--r-- | Mailman/Cgi/options.py | 7 | ||||
-rwxr-xr-x | Mailman/ListAdmin.py | 9 | ||||
-rwxr-xr-x | Mailman/MailList.py | 18 | ||||
-rw-r--r-- | Mailman/i18n.py | 5 |
6 files changed, 43 insertions, 23 deletions
diff --git a/Mailman/Bouncer.py b/Mailman/Bouncer.py index 21a4df38..ae0c012c 100644 --- a/Mailman/Bouncer.py +++ b/Mailman/Bouncer.py @@ -40,7 +40,8 @@ EMPTYSTRING = '' # for time.mktime(). ZEROHOUR_PLUSONEDAY = time.localtime(mm_cfg.days(1))[:3] -def _(s): return s +def D_(s): return s +_ = D_ REASONS = {MemberAdaptor.BYBOUNCE: _('due to excessive bounces'), MemberAdaptor.BYUSER: _('by yourself'), @@ -49,7 +50,6 @@ REASONS = {MemberAdaptor.BYBOUNCE: _('due to excessive bounces'), } _ = i18n._ -D_ = i18n.D_ @@ -265,10 +265,12 @@ class Bouncer: reason = self.getDeliveryStatus(member) if info.noticesleft <= 0: # BAW: Remove them now, with a notification message + _ = D_ self.ApprovedDeleteMember( - member, D_('disabled address'), + member, _('disabled address'), admin_notif=self.bounce_notify_owner_on_removal, userack=1) + _ = i18n._ # Expunge the pending cookie for the user. We throw away the # returned data. self.pend_confirm(info.cookie) diff --git a/Mailman/Cgi/admin.py b/Mailman/Cgi/admin.py index 984904a7..f44e01db 100644 --- a/Mailman/Cgi/admin.py +++ b/Mailman/Cgi/admin.py @@ -47,7 +47,8 @@ from Mailman.CSRFcheck import csrf_check # Set up i18n _ = i18n._ i18n.set_language(mm_cfg.DEFAULT_SERVER_LANGUAGE) -D_ = i18n.D_ +def D_(s): + return s NL = '\n' OPTCOLUMNS = 11 @@ -1483,9 +1484,12 @@ def change_options(mlist, category, subcat, cgidata, doc): else: mlist.InviteNewMember(userdesc, invitation) else: + _ = D_ + whence = _('admin mass sub') + _ = i18n._ mlist.ApprovedAddMember(userdesc, send_welcome_msg, send_admin_notif, invitation, - whence=D_('admin mass sub')) + whence=whence) except Errors.MMAlreadyAMember: subscribe_errors.append((safeentry, _('Already a member'))) except Errors.MMBadEmailError: @@ -1538,8 +1542,11 @@ def change_options(mlist, category, subcat, cgidata, doc): unsubscribe_success = [] for addr in names: try: + _ = D_ + whence = _('admin mass unsub') + _ = i18n._ mlist.ApprovedDeleteMember( - addr, whence=D_('admin mass unsub'), + addr, whence=whence, admin_notif=send_unsub_notifications, userack=userack) unsubscribe_success.append(Utils.websafe(addr)) @@ -1646,8 +1653,10 @@ def change_options(mlist, category, subcat, cgidata, doc): quser = urllib.quote(user) if cgidata.has_key('%s_unsub' % quser): try: - mlist.ApprovedDeleteMember(user, - whence=D_('member mgt page')) + _ = D_ + whence=_('member mgt page') + _ = i18n._ + mlist.ApprovedDeleteMember(user, whence=whence) removes.append(user) except Errors.NotAMemberError: errors.append((user, _('Not subscribed'))) diff --git a/Mailman/Cgi/options.py b/Mailman/Cgi/options.py index d563d253..c2a84ecb 100644 --- a/Mailman/Cgi/options.py +++ b/Mailman/Cgi/options.py @@ -45,7 +45,8 @@ DIGRE = re.compile( # Set up i18n _ = i18n._ i18n.set_language(mm_cfg.DEFAULT_SERVER_LANGUAGE) -D_ = i18n.D_ +def D_(s): + return s try: True, False @@ -582,9 +583,10 @@ address. Upon confirmation, any other mailing list containing the address mlist.Lock() needapproval = False try: + _ = D_ try: mlist.DeleteMember( - user, D_('via the member options page'), userack=1) + user, _('via the member options page'), userack=1) except Errors.MMNeedApproval: needapproval = True except Errors.NotAMemberError: @@ -596,6 +598,7 @@ address. Upon confirmation, any other mailing list containing the address pass mlist.Save() finally: + _ = i18n._ mlist.Unlock() # Now throw up some results page, with appropriate links. We can't # drop them back into their options page, because that's gone now! diff --git a/Mailman/ListAdmin.py b/Mailman/ListAdmin.py index d083a521..8825760a 100755 --- a/Mailman/ListAdmin.py +++ b/Mailman/ListAdmin.py @@ -45,7 +45,8 @@ from Mailman.Logging.Syslog import syslog from Mailman import i18n _ = i18n._ -D_ = i18n.D_ +def D_(s): + return s # Request types requiring admin approval IGN = 0 @@ -436,9 +437,11 @@ class ListAdmin: # subscribe assert value == mm_cfg.SUBSCRIBE try: + _ = D_ + whence = _('via admin approval') + _ = i18n._ userdesc = UserDesc(addr, fullname, password, digest, lang) - self.ApprovedAddMember(userdesc, - whence=D_('via admin approval')) + self.ApprovedAddMember(userdesc, whence=whence) except Errors.MMAlreadyAMember: # User has already been subscribed, after sending the request pass diff --git a/Mailman/MailList.py b/Mailman/MailList.py index 3e5a6232..d2a15e29 100755 --- a/Mailman/MailList.py +++ b/Mailman/MailList.py @@ -72,7 +72,8 @@ from Mailman import i18n from Mailman.Logging.Syslog import syslog _ = i18n._ -D_ = i18n.D_ +def D_(s): + return s EMPTYSTRING = '' OR = '|' @@ -1309,7 +1310,8 @@ class MailList(HTMLFormatter, Deliverer, ListAdmin, except ValueError: raise Errors.MMBadConfirmation, 'op-less data %s' % (rec,) if op == Pending.SUBSCRIPTION: - whence = D_('via email confirmation') + _ = D_ + whence = _('via email confirmation') try: userdesc = data[0] # If confirmation comes from the web, context should be a @@ -1318,7 +1320,7 @@ class MailList(HTMLFormatter, Deliverer, ListAdmin, # context is a Message and isn't relevant, so ignore it. if isinstance(context, UserDesc): userdesc += context - whence = D_('via web confirmation') + whence = _('via web confirmation') addr = userdesc.address fullname = userdesc.fullname password = userdesc.password @@ -1326,6 +1328,7 @@ class MailList(HTMLFormatter, Deliverer, ListAdmin, lang = userdesc.language except ValueError: raise Errors.MMBadConfirmation, 'bad subscr data %s' % (data,) + _ = i18n._ # Hack alert! Was this a confirmation of an invitation? invitation = getattr(userdesc, 'invitation', False) # We check for both 2 (approval required) and 3 (confirm + @@ -1348,11 +1351,14 @@ class MailList(HTMLFormatter, Deliverer, ListAdmin, return op, addr, password, digest, lang elif op == Pending.UNSUBSCRIPTION: addr = data[0] - # Log file messages don't need to be i18n'd + # Log file messages don't need to be i18n'd, but this is now in a + # notice. + _ = D_ if isinstance(context, Message.Message): - whence = D_('email confirmation') + whence = _('email confirmation') else: - whence = D_('web confirmation') + whence = _('web confirmation') + _ = i18n._ # 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 f39b1004..605d4e76 100644 --- a/Mailman/i18n.py +++ b/Mailman/i18n.py @@ -123,10 +123,7 @@ 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 |