diff options
| author | bwarsaw | 2000-12-26 20:20:13 +0000 |
|---|---|---|
| committer | bwarsaw | 2000-12-26 20:20:13 +0000 |
| commit | d578a5877660ecd5746366d0dba3684c1fe313fa (patch) | |
| tree | 62242cd20b2f6e81ffad20b9d958127e9d9b3b2d | |
| parent | 573bc3f5543df89d6c925b452984ab250387f81e (diff) | |
| download | mailman-d578a5877660ecd5746366d0dba3684c1fe313fa.tar.gz mailman-d578a5877660ecd5746366d0dba3684c1fe313fa.tar.zst mailman-d578a5877660ecd5746366d0dba3684c1fe313fa.zip | |
Latest round of jcrey's I18N patches. Specifically,
Select: New HTML widget type.
MESSAGES_DIR: The directory containing the translated .mo files.
DEFAULT_SERVER_LANGUAGE: The default language for this Mailman
installation.
LC_DESCRIPTIONS: Language/charset mappings.
| -rw-r--r-- | Mailman/Defaults.py.in | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Mailman/Defaults.py.in b/Mailman/Defaults.py.in index d3ba64fdd..d3b7ef354 100644 --- a/Mailman/Defaults.py.in +++ b/Mailman/Defaults.py.in @@ -512,6 +512,7 @@ EmailList = 6 Host = 7 Number = 8 FileUpload = 9 +Select = 10 # Held message disposition actions, for use between admindb.py and # ListAdmin.py. @@ -543,9 +544,12 @@ SPAM_DIR = os.path.join(VAR_PREFIX, 'spam') WRAPPER_DIR = os.path.join(EXEC_PREFIX, 'mail') SCRIPTS_DIR = os.path.join(PREFIX, 'scripts') TEMPLATE_DIR = os.path.join(PREFIX, 'templates') +MESSAGES_DIR = os.path.join(PREFIX, 'messages') PUBLIC_ARCHIVE_FILE_DIR = os.path.join(VAR_PREFIX, 'archives', 'public') PRIVATE_ARCHIVE_FILE_DIR = os.path.join(VAR_PREFIX, 'archives', 'private') +DEFAULT_SERVER_LANGUAGE = "en" + QUEUE_DIR = os.path.join(VAR_PREFIX, 'qfiles') INQUEUE_DIR = os.path.join(QUEUE_DIR, 'in') OUTQUEUE_DIR = os.path.join(QUEUE_DIR, 'out') @@ -556,3 +560,31 @@ SITE_PW_FILE = os.path.join(DATA_DIR, 'adm.pw') # Import a bunch of version numbers from Version import * + +# Vgg: Language descriptions and charsets dictionary, any new supported +# language must have a corresponding entry here. Key is the name of the +# directories that hold the localized texts. Data are tuples with first +# element being the description, as described in the catalogs, and second +# element is the language charset. I have chosen code from /usr/share/locale +# in my GNU/Linux. :-) +def _(string): + return string + +LC_DESCRIPTIONS = {'es': [_("Spanish (Spain)"), 'iso-8859-1'], + 'it': [_("Italian"), 'iso-8859-1'], + 'en': [_("English (USA)"), 'us-ascii'], + } +del _ + +# TDB: this may not be the right way to do this, but it's simple and it works +# for all entry points into the Mailman system. +# +# BAW: This will very likely change to a more explicit import of `_', probably +# based on the Mailman.i18n module. +import gettext + +os.environ['LANG'] = DEFAULT_SERVER_LANGUAGE +gettext.bindtextdomain('mailman', MESSAGES_DIR) +gettext.textdomain('mailman') +import __builtin__ +__builtin__.__dict__['_'] = gettext.gettext |
