diff options
author | Mark Sapiro <mark@msapiro.net> | 2016-02-27 20:38:34 -0800 |
---|---|---|
committer | Mark Sapiro <mark@msapiro.net> | 2016-02-27 20:38:34 -0800 |
commit | 056b6a968fb3f96ba3bf4dcc00b82370c043154e (patch) | |
tree | 77929103dd339d4b9676b654fff342c15d4ee64d /Mailman | |
parent | 95385417e926517c13ee769ef915ce5710a515f2 (diff) | |
download | mailman2-056b6a968fb3f96ba3bf4dcc00b82370c043154e.tar.gz mailman2-056b6a968fb3f96ba3bf4dcc00b82370c043154e.tar.xz mailman2-056b6a968fb3f96ba3bf4dcc00b82370c043154e.zip |
Added switch to disable the l10n cset recoding.
Diffstat (limited to 'Mailman')
-rwxr-xr-x | Mailman/Defaults.py.in | 7 | ||||
-rw-r--r-- | Mailman/i18n.py | 11 |
2 files changed, 15 insertions, 3 deletions
diff --git a/Mailman/Defaults.py.in b/Mailman/Defaults.py.in index 06b3e0ad..04d7db8a 100755 --- a/Mailman/Defaults.py.in +++ b/Mailman/Defaults.py.in @@ -153,6 +153,13 @@ ACCEPTABLE_LISTNAME_CHARACTERS = '[-+_.=a-z0-9]' # in list rosters? Defaults to No to preserve prior behavior. ROSTER_DISPLAY_REALNAME = No +# Beginning in Mailman 2.1.21, localized help and some other output from +# Mailman's bin/ commands is converted to the character set of the user's +# workstation (LC_CTYPE) if different from the character set of the language. +# This is not well tested over a wide range of locales, so if it causes +# problems, it can be disabled by setting the following to Yes. +DISABLE_COMMAND_LOCALE_CSET = No + ##### diff --git a/Mailman/i18n.py b/Mailman/i18n.py index 102bee83..b8b527e0 100644 --- a/Mailman/i18n.py +++ b/Mailman/i18n.py @@ -33,7 +33,8 @@ def _get_ctype_charset(): locale.setlocale(locale.LC_CTYPE, old) return charset -_ctype_charset = _get_ctype_charset() +if not mm_cfg.DISABLE_COMMAND_LOCALE_CSET: + _ctype_charset = _get_ctype_charset() @@ -114,8 +115,12 @@ def tolocale(s): return s return unicode(s, source, 'replace').encode(_ctype_charset, 'replace') -def C_(s): - return tolocale(_(s, 2)) +if mm_cfg.DISABLE_COMMAND_LOCALE_CSET: + C_ = _ +else: + def C_(s): + return tolocale(_(s, 2)) + def ctime(date): |