Multilingual wiki

A wiki can be set up to include different language versions of a wiki content. Wiki administrators have to make some decisions regarding how they want to support their wiki users' language in addition to simply providing translated content.

The following considerations refer to a single-wiki scenario and don't apply if the language versions are maintained in multiple wikis.

Concepts

To make a wiki multilingual, different aspects have to be considered:

  1. Content language and location of translated pages
  2. Translated content vs. interface elements
  3. Linking translated pages
  4. User language (set in the user's preferences)
  5. Multilingual navigation
  6. Multilingual templates
  7. Content organization (categories, portal pages)

The following information gives some suggestions how to organise a wiki around its multilingual content. It does not consider using the MediaWiki extension Translate which is often installed in multlingual wikis to faciliate a section-by-section translation of wiki pages.

Content language and location of translated pages

Usually, language versions of a page are maintained as subpages. For this to work well, we need to know the actual content language of the wiki, which will always act as the "parent" of the other language versions. To find out the content language of your wiki installation, you can place the variable {{CONTENTLANG}} on a wiki page and look at its output, which corresponds to the language's ISO 639-1 language code, a double-digit abbreviation. For an English wiki installation, it would be en.


Subpages: The language versions of a page would then live under its English parent page and use its language code as the subpage name: MyPage/de, MyPage/fr and so on. The pages can automatically be associated through a language template that relies on this subpage structure to "detect" the different language versions.


Namespaces: This setup assumes that you always have the same main language as a starting point for your translation. If this is not the case, you can also think about using namespaces for your different language versions. This makes sense when you have content in different languages, but the content in these languages is not necessarily always related. You could create namespaces for your languages as you see fit, e.g. DE: , FR: or IT-de:, IT-fr: and so on. If there are related pages between languages, they can be connected through interwikilinks.

Translated content vs. interface elements

Let's take a page called Dress code and create a German language version as a subpage. After saving the page Dress code/de with its translated content, it looks like this:


Now, we have the German translation that we wanted, but it is always shown in the context of the user language preferences of each user. This means that the user interface elements do not necessarily correspond to the translated language.

Another point to consider is that the page title is shown as "de", which is not what we want. To provide a meaningful title, we need to set it in the page options, under the Advanced Settings:

Setting the display title
Setting the display title


The search engine will index this display title so that the title search returns the expected result.

Linking translated pages

Now that we have a page with a language version, the user interface should indicate right away that a page has a translated version. This is best done with a language switcher template. Alternatively, you can also set up interwikilinks for this purpose. Let's compare the two options.

Language switcher

To show directly on a page whether language versions exist, a template needs to be included in the content area of each individual page. It creates a switcher that allows to "jump" between the pages.

Language switcher template
Language switcher template


A starting template to import into a wiki can be downloaded from the downloads page. For the template to work correctly, the template needs to be set to the specific content language of your wiki.

Interwikilinks

Another possible solution is to use interwikilinks to switch between the languages. In that case, the language switcher is automatically created in the top toolbar of the wiki, when a page contains interwikilinks.



To submit feedback about this documentation, visit our community forum.