Check out the new USENIX Web site. next up previous
Next: Unicode Up: Internationalization Issues Previous: Message Catalogs

Templates

While gettext style message text in Python source code are essential for an internationalized Mailman, they aren't always appropriate. For example, Mailman has always used templates as a way of conveniently representing full web pages or parts of email messages. These templates provide an easy way for site administrators to customize the look of the Mailman web pages, or the text sent out under various circumstances.

In an internationalized Mailman, the templates serve another purpose: they serve as a mechanism for providing language specific versions of the templates. Mailman uses almost 50 templates for various purposes, and of course provides the English versions of the templates as a default. Each supported language provides its own version of the templates, and Mailman has a defined search order for template lookup. For example, if Mailman were to display the public list overview page for a mailing list, it would search for the listinfo.html page, in the following locations (relative to the installation directory):

The first location to yield the desired template wins. Thus, as with the gettext catalogs, English is always an available fall back.

Templates, like marked translatable source code text, support variable substitutions, using the same syntax. With templates, an explicit substitution dictionary is always provided, and the interpolation is performed after the template is located.

While the template system works well enough, its coarseness is a serious drawback. For example, say a new feature required the addition of an HTML button on one of the templates. While this is trivial to do for the English template, changing the English template means all the other templates are out-of-date. The translation teams must follow up with new versions of the modified templates, or other languages will lag behind the English version.

One solution for templates might be something like Zope Page Templates (ZPT) [Pelletier], and specifically, internationalized ZPT [I18NZPT]. Internationalized ZPT combines the best of gettext and templates by allowing the template author to design the template, marking sections of the template as translatable text. Another extraction tool can then run over the ZPT file and add the translatable messages to the overall catalog. This has the huge advantage that structural changes to a template don't require the translation teams to do any work. Changes to content messages in the template simply mean that one phrase may be out of date, but the whole template won't be invalidated.


next up previous
Next: Unicode Up: Internationalization Issues Previous: Message Catalogs
Barry Warsaw 2003-04-08