aboutsummaryrefslogtreecommitdiffstats
path: root/Mailman
diff options
context:
space:
mode:
authorMark Sapiro <msapiro@value.net>2007-11-25 00:04:30 -0800
committerMark Sapiro <msapiro@value.net>2007-11-25 00:04:30 -0800
commitbd3617882ca74d8a36755a5133132556cfeb2968 (patch)
treefc81e0cd6be92bab1c1c3e1dcfe0e37ce3ff430f /Mailman
parent96201784fa8a262abdfa1c0ab3e6adaad4eeba98 (diff)
downloadmailman2-bd3617882ca74d8a36755a5133132556cfeb2968.tar.gz
mailman2-bd3617882ca74d8a36755a5133132556cfeb2968.tar.xz
mailman2-bd3617882ca74d8a36755a5133132556cfeb2968.zip
Mailman/Defaults.py.in
Mailman/Utils.py Mailman/htmlformat.py Mailman/Cgi/create.py messages/ja/doc/Defaults.py.in - Added direction ('ltr', 'rtl') to the LC_DESCRIPTIONS table to support the Hebrew translation. messages/he/LC_MESSAGES/mailman.po - Corrected a typo '\b' -> '\n'. messages/zh_CN/LC_MESSAGES/mailman.po - Corrected a typo '\\b' -> '/b'.
Diffstat (limited to '')
-rw-r--r--Mailman/Cgi/create.py4
-rw-r--r--Mailman/Defaults.py.in74
-rw-r--r--Mailman/Utils.py3
-rw-r--r--Mailman/htmlformat.py7
4 files changed, 47 insertions, 41 deletions
diff --git a/Mailman/Cgi/create.py b/Mailman/Cgi/create.py
index 50f06070..55ec2887 100644
--- a/Mailman/Cgi/create.py
+++ b/Mailman/Cgi/create.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2006 by the Free Software Foundation, Inc.
+# Copyright (C) 2001-2007 by the Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -392,7 +392,7 @@ def request_creation(doc, cgidata=dummy, errmsg=None):
# Create the table of initially supported languages, sorted on the long
# name of the language.
revmap = {}
- for key, (name, charset) in mm_cfg.LC_DESCRIPTIONS.items():
+ for key, (name, charset, direction) in mm_cfg.LC_DESCRIPTIONS.items():
revmap[_(name)] = key
langnames = revmap.keys()
langnames.sort()
diff --git a/Mailman/Defaults.py.in b/Mailman/Defaults.py.in
index c456c4a3..f8ea2e40 100644
--- a/Mailman/Defaults.py.in
+++ b/Mailman/Defaults.py.in
@@ -1330,42 +1330,42 @@ def _(s):
LC_DESCRIPTIONS = {}
-def add_language(code, description, charset):
- LC_DESCRIPTIONS[code] = (description, charset)
-
-add_language('ar', _('Arabic'), 'utf-8')
-add_language('ca', _('Catalan'), 'iso-8859-1')
-add_language('cs', _('Czech'), 'iso-8859-2')
-add_language('da', _('Danish'), 'iso-8859-1')
-add_language('de', _('German'), 'iso-8859-1')
-add_language('en', _('English (USA)'), 'us-ascii')
-add_language('es', _('Spanish (Spain)'), 'iso-8859-1')
-add_language('et', _('Estonian'), 'iso-8859-15')
-add_language('eu', _('Euskara'), 'iso-8859-15') # Basque
-add_language('fi', _('Finnish'), 'iso-8859-1')
-add_language('fr', _('French'), 'iso-8859-1')
-add_language('he', _('Hebrew'), 'utf-8')
-add_language('hr', _('Croatian'), 'iso-8859-2')
-add_language('hu', _('Hungarian'), 'iso-8859-2')
-add_language('ia', _('Interlingua'), 'iso-8859-15')
-add_language('it', _('Italian'), 'iso-8859-1')
-add_language('ja', _('Japanese'), 'euc-jp')
-add_language('ko', _('Korean'), 'euc-kr')
-add_language('lt', _('Lithuanian'), 'iso-8859-13')
-add_language('nl', _('Dutch'), 'iso-8859-1')
-add_language('no', _('Norwegian'), 'iso-8859-1')
-add_language('pl', _('Polish'), 'iso-8859-2')
-add_language('pt', _('Portuguese'), 'iso-8859-1')
-add_language('pt_BR', _('Portuguese (Brazil)'), 'iso-8859-1')
-add_language('ro', _('Romanian'), 'iso-8859-2')
-add_language('ru', _('Russian'), 'koi8-r')
-add_language('sr', _('Serbian'), 'utf-8')
-add_language('sl', _('Slovenian'), 'iso-8859-2')
-add_language('sv', _('Swedish'), 'iso-8859-1')
-add_language('tr', _('Turkish'), 'iso-8859-9')
-add_language('uk', _('Ukrainian'), 'utf-8')
-add_language('vi', _('Vietnamese'), 'utf-8')
-add_language('zh_CN', _('Chinese (China)'), 'utf-8')
-add_language('zh_TW', _('Chinese (Taiwan)'), 'utf-8')
+def add_language(code, description, charset, direction='ltr'):
+ LC_DESCRIPTIONS[code] = (description, charset, direction)
+
+add_language('ar', _('Arabic'), 'utf-8', 'rtl')
+add_language('ca', _('Catalan'), 'iso-8859-1', 'ltr')
+add_language('cs', _('Czech'), 'iso-8859-2', 'ltr')
+add_language('da', _('Danish'), 'iso-8859-1', 'ltr')
+add_language('de', _('German'), 'iso-8859-1', 'ltr')
+add_language('en', _('English (USA)'), 'us-ascii', 'ltr')
+add_language('es', _('Spanish (Spain)'), 'iso-8859-1', 'ltr')
+add_language('et', _('Estonian'), 'iso-8859-15', 'ltr')
+add_language('eu', _('Euskara'), 'iso-8859-15', 'ltr') # Basque
+add_language('fi', _('Finnish'), 'iso-8859-1', 'ltr')
+add_language('fr', _('French'), 'iso-8859-1', 'ltr')
+add_language('he', _('Hebrew'), 'utf-8', 'rtl')
+add_language('hr', _('Croatian'), 'iso-8859-2', 'ltr')
+add_language('hu', _('Hungarian'), 'iso-8859-2', 'ltr')
+add_language('ia', _('Interlingua'), 'iso-8859-15', 'ltr')
+add_language('it', _('Italian'), 'iso-8859-1', 'ltr')
+add_language('ja', _('Japanese'), 'euc-jp', 'ltr')
+add_language('ko', _('Korean'), 'euc-kr', 'ltr')
+add_language('lt', _('Lithuanian'), 'iso-8859-13', 'ltr')
+add_language('nl', _('Dutch'), 'iso-8859-1', 'ltr')
+add_language('no', _('Norwegian'), 'iso-8859-1', 'ltr')
+add_language('pl', _('Polish'), 'iso-8859-2', 'ltr')
+add_language('pt', _('Portuguese'), 'iso-8859-1', 'ltr')
+add_language('pt_BR', _('Portuguese (Brazil)'), 'iso-8859-1', 'ltr')
+add_language('ro', _('Romanian'), 'iso-8859-2', 'ltr')
+add_language('ru', _('Russian'), 'koi8-r', 'ltr')
+add_language('sr', _('Serbian'), 'utf-8', 'ltr')
+add_language('sl', _('Slovenian'), 'iso-8859-2', 'ltr')
+add_language('sv', _('Swedish'), 'iso-8859-1', 'ltr')
+add_language('tr', _('Turkish'), 'iso-8859-9', 'ltr')
+add_language('uk', _('Ukrainian'), 'utf-8', 'ltr')
+add_language('vi', _('Vietnamese'), 'utf-8', 'ltr')
+add_language('zh_CN', _('Chinese (China)'), 'utf-8', 'ltr')
+add_language('zh_TW', _('Chinese (Taiwan)'), 'utf-8', 'ltr')
del _
diff --git a/Mailman/Utils.py b/Mailman/Utils.py
index a3badf47..2641875c 100644
--- a/Mailman/Utils.py
+++ b/Mailman/Utils.py
@@ -674,6 +674,9 @@ def GetLanguageDescr(lang):
def GetCharSet(lang):
return mm_cfg.LC_DESCRIPTIONS[lang][1]
+def GetDirection(lang):
+ return mm_cfg.LC_DESCRIPTIONS[lang][2]
+
def IsLanguage(lang):
return mm_cfg.LC_DESCRIPTIONS.has_key(lang)
diff --git a/Mailman/htmlformat.py b/Mailman/htmlformat.py
index 1a0bd22d..7152e1f0 100644
--- a/Mailman/htmlformat.py
+++ b/Mailman/htmlformat.py
@@ -1,4 +1,4 @@
-# Copyright (C) 1998-2006 by the Free Software Foundation, Inc.
+# Copyright (C) 1998-2007 by the Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -327,7 +327,10 @@ class Document(Container):
kws.setdefault('link', mm_cfg.WEB_LINK_COLOR)
for k, v in kws.items():
quals.append('%s="%s"' % (k, v))
- output.append('%s<BODY %s>' % (tab, SPACE.join(quals)))
+ output.append('%s<BODY %s' % (tab, SPACE.join(quals)))
+ # Language direction
+ direction = Utils.GetDirection(self.language)
+ output.append('dir="%s">' % direction)
# Always do this...
output.append(Container.Format(self, indent))
if not self.suppress_head: