[Easterhegg2013] [TitleIndex] [WordIndex

How to specify the page language

language_default (in wikiconfig) sets the default language of a wiki's content.

The HTML lang attribute of a page's BODY tag is set to this language, except if you specify a different page content language in the page header like this:

#language he

The language name is the iso-639-1 name of the language. Languages that moin does not support are ignored.

This is critical if the wiki contains content in different directions, like Hebrew pages, which should display in right to left direction, and English pages, which should display in left to right direction.

In the past, system pages had a language comment: ##language:en. This comment has no effect, and should be changed to the new #language en format. To repair old pages in your wiki, run scripts.repair_language.py in your wiki data directory. Back up your wiki data directory before doing this!

Language Macros

For each language MoinMoin supports in its user interface, a corresponding <<lang>> macro exists, e.g. <<en>>.

Use this macro to:

Built-in vs. user-specified translations

MoinMoin normally uses built-in translation (see MoinMoin/i18n/*) for translating user interface text and system page names in navi_bar.

But there is the possibility to customize navi_bar with your own stuff. Moin has no built-in translation for that usually, so what to do if you want to have them translated the same way as FrontPage usually is?

Simply create some pages like GermanDict, FrenchDict, Simplified_ChineseDict etc. (use the english name of the language) and put a definition list on them which defines the translations for the English terms, e.g. on page GermanDict:

 MyProject:: MeinProjekt
 LatestNews:: NeuesteNachrichten

(!) Note the space before the lines. If you do not put that space, Moin will not consider the entries as dictionnary entries. See WikiDict for details.

Moin then will use those dict pages if it can't find the text in its built-in translation dictionaries.


2013-07-19 18:27