aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortkikuchi <>2004-11-07 11:58:42 +0000
committertkikuchi <>2004-11-07 11:58:42 +0000
commitdc718080a678caa57bd018efe699e2208f651dfb (patch)
treee026cbcf2430b731aaff6fbc3c6b6179daef25da
parent61e69503320da03ddbbc07d6d35846d84724aea4 (diff)
downloadmailman2-dc718080a678caa57bd018efe699e2208f651dfb.tar.gz
mailman2-dc718080a678caa57bd018efe699e2208f651dfb.tar.xz
mailman2-dc718080a678caa57bd018efe699e2208f651dfb.zip
i18n minor bug fix.
Diffstat (limited to '')
-rwxr-xr-xcron/mailpasswds15
1 files changed, 9 insertions, 6 deletions
diff --git a/cron/mailpasswds b/cron/mailpasswds
index 86f49d18..8f1d776d 100755
--- a/cron/mailpasswds
+++ b/cron/mailpasswds
@@ -193,9 +193,6 @@ def main():
poplang = lang
langcnt = cnt
enc = Utils.GetCharSet(poplang)
- # Craft the table header
- header = '%-40s %-10s\n%-40s %-10s' % (
- _('List'), _('Password // URL'), '----', '--------')
# Now we're finally ready to send the email!
siteowner = Utils.get_site_email(host, 'owner')
sitereq = Utils.get_site_email(host, 'request')
@@ -210,16 +207,22 @@ def main():
# Coerce everything to Unicode
text = tounicode(text, enc)
table = [tounicode(_t, enc) for _t in table]
- # Add the table to the end so it doesn't get wrapped/filled
- text += (header + '\n' + NL.join(table))
# Translate the message and headers to user's suggested lang
otrans = i18n.get_translation()
try:
i18n.set_language(poplang)
+ # Craft table header after language was set
+ header = '%-40s %-10s\n%-40s %-10s' % (
+ _('List'), _('Password // URL'), '----', '--------')
+ header = tounicode(header, enc)
+ # Add the table to the end so it doesn't get wrapped/filled
+ text += (header + '\n' + NL.join(table))
msg = Message.UserNotification(
addr, siteowner,
_('%(host)s mailing list memberships reminder'),
- text, poplang)
+ text.encode(enc), poplang)
+ # Note that text must be encoded into 'enc' because unicode
+ # cause error within email module in some language (Japanese).
finally:
i18n.set_translation(otrans)
msg['X-No-Archive'] = 'yes'