summaryrefslogtreecommitdiff
path: root/Mailman/Cgi/edithtml.py
diff options
context:
space:
mode:
authorbwarsaw2000-12-26 18:20:01 +0000
committerbwarsaw2000-12-26 18:20:01 +0000
commite5c72c764a5ddb42c1b927d89047c8b2af336043 (patch)
tree6c109e1ce2fc99133403d9d1aa8c3efeaf450c06 /Mailman/Cgi/edithtml.py
parent369e010d18dced7e3cd25255fc06830ad7cbc56b (diff)
downloadmailman-e5c72c764a5ddb42c1b927d89047c8b2af336043.tar.gz
mailman-e5c72c764a5ddb42c1b927d89047c8b2af336043.tar.zst
mailman-e5c72c764a5ddb42c1b927d89047c8b2af336043.zip
Diffstat (limited to 'Mailman/Cgi/edithtml.py')
-rw-r--r--Mailman/Cgi/edithtml.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/Mailman/Cgi/edithtml.py b/Mailman/Cgi/edithtml.py
index 8c7f8fec3..5e4484d2f 100644
--- a/Mailman/Cgi/edithtml.py
+++ b/Mailman/Cgi/edithtml.py
@@ -19,6 +19,7 @@
import os
import cgi
import string
+import gettext
from Mailman import Utils
from Mailman import MailList
@@ -31,6 +32,8 @@ from Mailman.Logging.Syslog import syslog
def main():
+ def _(string): return string
+
template_data = (
('listinfo.html', _('General list information page')),
('subscribe.html', _('Subscribe results page')),
@@ -38,6 +41,7 @@ def main():
('handle_opts.html', _('Changing user options results page')),
)
+ _ = gettext.gettext
doc = Document()
parts = Utils.GetPathPieces()
if not parts:
@@ -54,6 +58,8 @@ def main():
syslog('error', _('No such list "%s": %s\n') % (listname, e))
return
+ os.environ['LANG'] = mlist.preferred_language
+
# Must be authenticated to get any farther
cgidata = cgi.FieldStorage()
try:
@@ -130,7 +136,9 @@ def ChangeHTML(mlist, cgi_info, template_name, doc):
doc.AddItem('<hr>')
return
code = cgi_info['html_code'].value
- f = open(os.path.join(mlist._template_dir, template_name), 'w')
+ f = open(os.path.join(mlist._template_dir, mlist.preferred_language,
+ template_name),
+ 'w')
f.write(code)
f.close()
doc.AddItem(Header(3, _('HTML successfully updated.')))