MoinMoin supports more than 10 languages, both in user interface and in system pages. This page describe how this support work, and how to solve common problems. Problems that don't have a good solution yet are discussed in /Problems.

This page overlaps with HelpOnLanguages. HelpOnLanguages should be much simpler and shorter, focused on users, while this page should have more technical details and focused on administrators developers who want to understand how the system work.

It should replace most of the content in HebrewSupport, since the problems are related to many languages. Its not a help page, but more technical documentation and discussion.

Controlling language and direction

MoinMoin support language and direction from wiki level to single section within a page. Character level support can be easily added by a macro.

Wiki Language

The default_lang configuration option set the default language and direction for all pages. It does not have much effect for English and other left to right languages, but its critical for Persian, Hebrew, Arabic or other right to left wikis.

For right to left wiki, you must set this to your language name, e.g default_lang = "he". For left to right wiki, "en" will do just fine.

Page language

When you create a page using other language then the wiki default language, you must use a #language name processing instruction. Put it on the start of the page:

#language he

The language name is the iso-639-1 name listed in MoinMoin/i18n/meta.py. See also http://www.loc.gov/standards/iso639-2/englangn.html.

Section language

When you create a section in left to right language within a right to left language page, for example shell commands in a Hebrew wiki, you can use a language macro:

#language he

This page uses the page language…

<<en>>
{{{
cp -r this here
}‪}}
<<he>>

Using page language again…

You don't need this for code display, because there is no code in Hebrew:

   1 print "Code is display always in left to right"

Character direction

This is rarely needed. If you want this, you can call the language macros with text:

Left to right <<he(ימין לשמאל!)>> more left to right.

Left to right ימין לשמאל! more left to right.

Using Unicode bidirectional characters

This is another way to control direction. Its generally hard to use because the bidirectional characters are invisible. Even worse, in some cases (Safari using Arial font from Microsoft core fonts package) these characters are hidden in the editor, but show in the rendered page!

However, if entities flag XXX is enabled in the wiki configuration, its quite easy to add them as SGML entities.

Hex

Decimal

Name

Meaning

202A

8234

LRE

Start LTR Embedding

202B

8235

RLE

Start RTL Embedding

202C

8236

PDF

Pop directional format

Usage:

Left to right &#8235;right to left&#8236; more left to right.

Setting front page and wiki title

To setup Moin so it can use non ASCII characters in Title or for front page name you should set the encoding as utf-8 in configuration file, by default it's set to iso-8859-1. Change to:

# -*- coding: utf-8 -*-

Translated resources

User interface language

When a non registered user visit your wiki, the wiki checks the Accept-Language http header sent by the browser, and serve the requested page using the browser language. This can lead to problems if the browsers is not configured correctly (see /Problems). Registered users can set their preferred language in their UserPreferences.

User interface include the wiki header, sidebar and footer, and any part of the page generated by the wiki. For example, search results will be displayed in your language and direction.

This feature make it possible for user speaking different languages to use the same wiki in the comfort of their native language in the same time.

Language sensitive extensions

How to write an extension that show results in the user language.

Write me

Translated navigation bar

You navigation bar contain the main pages of your wiki. The default is FrontPage, RecentChanges, FindPage and HelpContents. Any page name you add to this list will be automatically translated to the user language.

If a user require Hebrew, either with browser setting or MoinMoin user preferences, and visiting http://example.com/mywiki/, he will get the Hebrew translated FrontPage, פתיחה, and all the other pages in the navigation bar will show the Hebrew names.

A page name is translated only if the wiki knows about the language, the wiki translation contain a translation for the name, and a page with that translation exists. If any of this is false, the original name will be displayed.

This feature make it possible to serve a multi language wiki out of the box. This can be a problem if you don't want to serve pages in some or all other languages, and you did not remove the unwanted languages from your wiki.

Adding wiki specific translations

If you want to add a new page and all its translations to the navigation bar, you must add the translations to the wiki. The easiest way to do this without having to edit MoinMoin .po files is add language dict pages.

For each language you want to add translations to, create a LanguageDict page, where Language is the English name of that language, e.g. GermanDict. In this page, add a definition list of English terms and their translation in that language:

 MyProject:: MeinProjekt
 LatestNews:: NeuesteNachrichten

MoinMoin uses these dict pages if it can't find the term in its built-in translation dictionaries.

Translated system and help pages

MoinMoin ships with almost 800 system and help pages in more than 10 languages. Out of the box, the wiki can serve multiple users, each using a translated system pages like RecentChanges, or looking for help in the translated help pages.

To see a list of translated languages, visit SystemPagesGroup. To a list of all pages in each language, see SystemPagesInLanguageGroup where Language is the English name of the language, e.g SystemPagesInHebrewGroup.

This feature is also a problem, see /Problems.

MoinMoin: MultipleLanguagesSupport (last edited 2012-02-24 02:53:50 by SalmanMohammadi)