Multilingual wiki: Difference between revisions

No edit summary
No edit summary
Line 4: Line 4:


== Concepts ==
== Concepts ==
To make a wiki multilingual, different aspects have to be considered:
To make a wiki multilingual, the following steps are suggested:


# Content language and location of translated pages
# Import a '''language switcher'''
# Translated content vs. interface elements
# Create  wiki pages with '''linked''' '''translation subpages'''
# Linking translated pages
# Set '''multilingual navigation'''
# User language (set in the user's preferences)
# Create '''page lists''' from language versions
# Multilingual navigation
# Multilingual templates
# 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.
The following information gives some suggestions how to  organise a wiki around its multilingual content. It does not consider using the MediaWiki extension [[mediawikiwiki:Extension:Translate|Translate]] which is often installed in multlingual wikis to faciliate a section-by-section translation of wiki pages. If most of your wiki content needs consistently accurate translations, this extension can be useful.


== Content language and location of translated pages ==
== Language switcher ==
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 <code><nowiki>{{CONTENTLANG}}</nowiki></code> on a wiki page and look at its output, which corresponds to the language's [[wikipedia:List_of_ISO_639-1_codes|ISO 639-1  language code]], a double-digit abbreviation. For an English wiki installation, it would be <code>en</code>.  
To show that a page has different versions, it is useful to indicate this with a language switcher on each page. If you have no language switcher in your wiki, you can [[Templates download/Language switcher|download a language switcher template]]. Be sure to read the configuration instructions on the downloads page. You need to adjust the languages you want to support in the template.


[[File:language-switcher-template.png|alt=language switcher on a wiki page|center|thumb|450x450px|language switcher on a wiki page]]


'''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.
== Wiki pages with linked language subpages ==
 
 
'''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. <code>DE:</code> , <code>FR:</code> or <code>IT-de:</code>, <code>IT-fr:</code> and so on. If there are related pages between languages, they can be connected through [[Manual:Extension/BlueSpiceInterWikiLinks|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/d''e with its translated content, it looks like this:<gallery widths="500" heights="350">
Let's take a page called ''Dress code'' and create a German language version as a subpage. After saving the page ''Dress code/d''e with its translated content, it looks like this:<gallery widths="500" heights="350">
File:language-subpage-de.png|alt=German content version with user language preference English.|German content version with user language preference English.
File:language-subpage-de.png|alt=German content version with user language preference English.|German content version with user language preference English.
Line 32: Line 25:




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'':
Now, we have the German translation that we wanted. 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. But since the user decided on this language preference, it does not negatively effect the user.
 
Another point to consider is that the page title is shown as "de", which is not always what we want. To provide a meaningful title, we need to set it in the page options, under the ''Advanced Settings'':
[[File:language-displaytitle.png|alt=Setting the display title|center|thumb|650x650px|Setting the display title]]
[[File:language-displaytitle.png|alt=Setting the display title|center|thumb|650x650px|Setting the display title]]




The search engine will index this display title  so that the title search returns the expected result.
The search engine will index this display title  so that the title search returns the expected result.
=== Adding the language switcher to a page ===
To add the language switcher to a page:
# '''Open''' the page in edit mode.
# '''Insert''' the template Languages form the editor toolbar.
# '''Enter''' a display title for the page (recommended for subpages).
#
#


== Linking translated pages ==
== Linking translated pages ==
Line 52: Line 55:
=== Interwikilinks ===
=== 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.
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.
'''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. <code>DE:</code> , <code>FR:</code> or <code>IT-de:</code>, <code>IT-fr:</code> and so on. If there are related pages between languages, they can be connected through [[Manual:Extension/BlueSpiceInterWikiLinks|interwikilinks]].

Revision as of 10:08, 24 March 2022

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, the following steps are suggested:

  1. Import a language switcher
  2. Create wiki pages with linked translation subpages
  3. Set multilingual navigation
  4. Create page lists from language versions

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. If most of your wiki content needs consistently accurate translations, this extension can be useful.

Language switcher

To show that a page has different versions, it is useful to indicate this with a language switcher on each page. If you have no language switcher in your wiki, you can download a language switcher template. Be sure to read the configuration instructions on the downloads page. You need to adjust the languages you want to support in the template.

language switcher on a wiki page
language switcher on a wiki page

Wiki pages with linked language subpages

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. 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. But since the user decided on this language preference, it does not negatively effect the user.

Another point to consider is that the page title is shown as "de", which is not always 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.

Adding the language switcher to a page

To add the language switcher to a page:

  1. Open the page in edit mode.
  2. Insert the template Languages form the editor toolbar.
  3. Enter a display title for the page (recommended for subpages).

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.


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.



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