summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbwarsaw2002-03-01 00:12:38 +0000
committerbwarsaw2002-03-01 00:12:38 +0000
commitdd19ab8c2c701b6c49e1d87f827596ba17826a06 (patch)
tree952fbe1c05661d74dfdb29647834272b1bf98be9
parentfe3a3439927827c2aac8ae6881d73273114c6250 (diff)
downloadmailman-dd19ab8c2c701b6c49e1d87f827596ba17826a06.tar.gz
mailman-dd19ab8c2c701b6c49e1d87f827596ba17826a06.tar.zst
mailman-dd19ab8c2c701b6c49e1d87f827596ba17826a06.zip
HoldUnsubscription(): Pass the list's preferred language to the
UserNotification constructor so that the admin gets the unsub request notice in the proper language. __refuse(): Be sure to create the Subject: header and other i18n text in the language of the recipient of the rejection message.
-rw-r--r--Mailman/ListAdmin.py34
1 files changed, 20 insertions, 14 deletions
diff --git a/Mailman/ListAdmin.py b/Mailman/ListAdmin.py
index dc60a8b77..79d98e2eb 100644
--- a/Mailman/ListAdmin.py
+++ b/Mailman/ListAdmin.py
@@ -429,10 +429,8 @@ class ListAdmin:
# This message should appear to come from the <list>-owner so as
# to avoid any useless bounce processing.
owneraddr = self.GetOwnerEmail()
- msg = Message.UserNotification(owneraddr, owneraddr, subject, text)
- msg['MIME-Version'] = '1.0'
- msg.add_header('Content-Type', 'text/plain',
- charset=Utils.GetCharSet(self.preferred_language))
+ msg = Message.UserNotification(owneraddr, owneraddr, subject, text,
+ self.preferred_language)
msg.send(self, **{'tomoderators': 1})
def __handleunsubscription(self, record, value, comment):
@@ -453,10 +451,13 @@ class ListAdmin:
return REMOVE
def __refuse(self, request, recip, comment, origmsg=None, lang=None):
+ # As this message is going to the requestor, try to set the language
+ # to his/her language choice, if they are a member. Otherwise use the
+ # list's preferred language.
adminaddr = self.GetAdminEmail()
realname = self.real_name
if lang is None:
- lang = self.preferred_language
+ lang = self.getMemberLanguage(recip)
text = Utils.maketext(
'refuse.txt',
{'listname' : realname,
@@ -464,15 +465,20 @@ class ListAdmin:
'reason' : comment,
'adminaddr': adminaddr,
}, lang=lang, mlist=self)
- # add in original message, but not wrap/filled
- if origmsg:
- text = NL.join(
- [text,
- '---------- ' + _('Original Message') + ' ----------',
- str(origmsg)
- ])
- subject = _('Request to mailing list %(realname)s rejected')
- msg = Message.UserNotification(recip, adminaddr, subject, text)
+ otrans = i18n.get_translation()
+ i18n.set_language(lang)
+ try:
+ # add in original message, but not wrap/filled
+ if origmsg:
+ text = NL.join(
+ [text,
+ '---------- ' + _('Original Message') + ' ----------',
+ str(origmsg)
+ ])
+ subject = _('Request to mailing list %(realname)s rejected')
+ finally:
+ i18n.set_translation(otrans)
+ msg = Message.UserNotification(recip, adminaddr, subject, text, lang)
msg.send(self)