From bdb6017365cef7ae26e6e2a8dc9cabc11842234a Mon Sep 17 00:00:00 2001 From: bwarsaw Date: Tue, 26 Dec 2000 19:52:00 +0000 Subject: maketext(): New optional parameter `lang' which is the language to use. Maps to the language-specific subdirectory within the template directory. --- Mailman/Utils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Mailman/Utils.py') diff --git a/Mailman/Utils.py b/Mailman/Utils.py index f25dff557..9594bf7f5 100644 --- a/Mailman/Utils.py +++ b/Mailman/Utils.py @@ -491,16 +491,18 @@ class SafeDict(UserDict): return '' % `key` -def maketext(templatefile, dict=None, raw=0): +def maketext(templatefile, dict=None, raw=0, lang=None): """Make some text from a template file. Reads the `templatefile', relative to mm_cfg.TEMPLATE_DIR, does string substitution by interpolating in the `dict', and if `raw' is false, wraps/fills the resulting text by calling wrap(). """ + if lang is None: + lang = mm_cfg.DEFAULT_SERVER_LANGUAGE if dict is None: dict = {} - file = os.path.join(mm_cfg.TEMPLATE_DIR, templatefile) + file = os.path.join(mm_cfg.TEMPLATE_DIR, lang, templatefile) fp = open(file) template = fp.read() fp.close() -- cgit v1.2.3-70-g09d2