Multilingual wiki: Difference between revisions

No edit summary
No edit summary
Line 1: Line 1:
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.
{{DISPLAYTITLE:Multilingual wiki (single 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 each wiki user's language setting 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.
The following considerations refer to a single-wiki scenario and don't apply if the language versions are maintained in multiple wikis.


== Concepts ==
== Concepts ==
To make a wiki multilingual, the following steps are suggested:
To make a wiki multilingual, the some basic steps are necessary:


# Import a '''language switcher'''
* Import a '''language switcher'''
# Create  wiki pages with '''linked''' '''translation subpages'''
* Create  wiki pages with '''linked''' '''translation subpages'''
# Set '''multilingual navigation'''
# 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 [[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.


== Language switcher ==
In addition, depending on your wiki setup, further aspects can and should be considered:
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.
* Create '''page lists''' for each language with different filter settings
* Create '''portal pages''' based on user language
* Create '''template and form labels''' based on user language
* Create a multilingual '''category system'''
* Create multilingual '''navigation links'''
 
 
The following information gives you some suggestions for 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.
 
== Importing the 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 [[Templates download/Language switcher|download a language switcher template]]. The techniques shown in the following sections assume that this language switcher is installed.
 
Be sure to read the configuration instructions on the downloads page. You need to define the languages that 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]]
[[File:language-switcher-template.png|alt=language switcher on a wiki page|center|thumb|450x450px|language switcher on a wiki page]]


== Wiki pages with linked language subpages ==
== Creating wiki pages with translated subpages ==
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 ''Vacation policy'' and create a German language version as a subpage. After saving the page ''Vacation policy/d''e and providing the content translation, we have the German translation that we wanted.  As you can see in the screenshots below, the page content 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, but actually supports the user when navigating the wiki.
File:language-subpage-de.png|alt=German content version with user language preference English.|German content version with user language preference English.
 
<gallery widths="500" heights="350">
File:language-subpage-de.png|alt=German content version with user language preference English.|German content version (1) with user language preference English (2).
File:language-subpage-de-uselang-de.png|alt=German content version with user language preference German.|German content version with user language preference German.
File:language-subpage-de-uselang-de.png|alt=German content version with user language preference German.|German content version with user language preference German.
</gallery>
</gallery>
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.


=== Adding the language switcher to a page ===
=== Adding the language switcher to a page ===
To add the language switcher to a page:
Now that we have two language versions, we want to connect them. with the language switcher. To add the language switcher to a page:
 
# '''Open''' the page in edit mode.
# '''Open''' the page in edit mode.
# '''Insert''' the template Languages form the editor toolbar.
# '''Insert''' the template Languages form the editor toolbar.
# '''Enter''' a display title for the page (recommended for subpages).[[File:language-displaytitle.png|link=https://en.wiki.bluespice.com/wiki/File:language-displaytitle.png|alt=Setting the display title|center|thumb|450x450px|Setting the display title]]The search engine will index this display title  so that the title search returns the expected result.
# '''Enter''' a display title for the page (recommended for subpages).[[File:language-displaytitle.png|link=https://en.wiki.bluespice.com/wiki/File:language-displaytitle.png|alt=Setting the display title|center|thumb|450x450px|Setting the display title]]The search engine will index this display title  so that the title search returns the expected result.
# '''Save''' the page.
# '''Save''' the page.
# '''Repeat''' steps 1-4 with the other language subpages.
# '''Repeat''' steps 1-4 with other language subpages (e.g, fr, nl).
 
 
The language switcher now indicates directly on a page if and what other languages are already available for that page.
[[File:languageswitcher-DE.png|alt=Language switcher shows all available translations|center|thumb|650x650px|The language switcher shows all available translations]]
#  
#  
#  
#  


=== Multilingual navigation ===
== Creating page lists for different languages ==
Currently, there is no easy mechanism to create multilingual navigation menus, such as the main navigation or the custom menu. More support should be coming in one of the next minor releases of BlueSpice (4.1.3 or 4.1.4). In the meantime, you can create [[Manual:Extension/BlueSpiceDiscovery/Main navigation/Language support|individual links based on a user's language settings]].  
Over time, a wiki can have lots of these translated pages.  We want to make sure that users know what pages are available in what languages. For this purpose, the language switcher template includes a custom property L''anguages/tracklang'' that allows to easily create filtered page lists for this purpose.


== Page lists for different languages ==
Working with properties requires the Semantic MediaWiki extensions, which are bundled in ''BlueSpice pro'', but not in ''BlueSpice free''. There are, however, [[Multilingual wiki#Alternative solutions in BlueSpice free|alternative approaches for creating page lists in ''BlueSpice free'']].  
The language switcher templates includes a custom property L''anguages/tracklang'' that allows to easily create page lists for the different languages. To create a page that lists all German subpages for example, you can include different SMW queries on any wiki page.


This example would list German language pages in a category-type output (A-Z listing):<syntaxhighlight lang="text">
In ''BlueSpice pro,'' you can include different inline queries on any wiki page. This example lists German language pages in the main namespace  and displays them in a category-type output (A-Z listing):<syntaxhighlight lang="text">
{{#ask:
{{#ask:
[[:+]][[Languages/tracklang::de]]
[[:+]][[Languages/tracklang::de]]
|format=category
|format=category
}}
}}
</syntaxhighlight>Explanation of the arguments for this query:
</syntaxhighlight>
[[File:languageswitcher-ask-result-category-de.png|alt=Results format "category"|center|thumb|450x450px|Results format "category"]]
Explanation of the arguments for this query:


* <nowiki>[[:+]]</nowiki>: Returns pages only in the main namespace. To show the pages form the entire wiki, simply delete this argument.
* '''<nowiki>[[:+]]</nowiki>''': Returns pages only in the main namespace. To show the pages form the entire wiki, simply delete this argument.
** <nowiki>[[QM::+]]</nowiki>: Returns pages from the namespace QM
**<nowiki>[[QM::+]]</nowiki>: Returns pages from the namespace QM
** <nowiki>[[QM:+||Help:+]]</nowiki>: Returns pages from the namespaces QM and Help.
**<nowiki>[[QM:+||Help:+]]</nowiki>: Returns pages from the namespaces QM and Help.
* <nowiki>[[Languages/tracklang::de]]</nowiki>: Returns only pages that are marked by the language switcher template as German language pages. Other options:
* '''<nowiki>[[Languages/tracklang::de]]</nowiki>''': Returns only pages that are marked by the language switcher template as German language pages. Other options:
**<nowiki>[[Languages/tracklang::+]]</nowiki>: Returns all language pages that are tracked in the wiki by the language switcher template.
**<nowiki>[[Languages/tracklang::+]]</nowiki>: Returns all language pages that are tracked in the wiki by the language switcher template.
** <nowiki>[[Languages/tracklang::!de]]</nowiki>: Returns all language pages except German pages.
**<nowiki>[[Languages/tracklang::!de]]</nowiki>: Returns all language pages except German pages.
** <nowiki>[[Languages/tracklang::de||fr]]</nowiki>: Returns all language pages in German and French (in the example above restricted to the main namespace.
**<nowiki>[[Languages/tracklang::de||fr]]</nowiki>: Returns all language pages in German and French (in the example above restricted to the main namespace.
* format=category: returns a category style output.  
* '''format=category''': returns a category style output.  
** format=ul: returns a list style output
** format=ul: returns a list style output
[[File:languageswitcher-ask-result-de.png|alt=Results format "ul"|center|thumb|250x250px|Results format "ul"]]




To see more query examples, go to our [[SMW queries|SMW-query examples]] page.
To see more examples for how to define and further modify a query for creating page lists, go to our [[SMW queries|SMW-query examples]] page.
 
== Creating portal pages based on user language settings ==
Portal pages are pages  that serve as entry points to different topics or areas in the portal, often considering the needs of specific user groups. A typical example is the main page of the wiki, which is often used to give users a high-level orientation in the wiki. A portal page is a good place to also consider the language needs of different users.
 
Here, we can take two different approaches:
 
# Provide the same page to all users, but include some content that targets specific user languages.
# Provide completely separate content to users based on their user language.
 
=== What is the user language? ===
Wiki users  can change their own language setting in the user preferences:
[[File:userlanguage.png|alt=User language preference|center|thumb|550x550px|User language preference]]
Depending on this setting, users then see the user interface elements in that language as we have seen in [[Multilingual wiki#Creating wiki pages with translated subpages|previous screenshots]].
 
=== Multilingual navigation ===
Currently, there is no easy mechanism to create multilingual navigation menus, such as the main navigation or the custom menu. More support should be coming in one of the next minor releases of BlueSpice (4.1.3 or 4.1.4). In the meantime, you can create [[Manual:Extension/BlueSpiceDiscovery/Main navigation/Language support|individual links based on a user's language settings]].
 
== Alternative solutions in BlueSpice free ==
[[Category:Multilingual wiki]]
[[Category:Multilingual wiki]]

Revision as of 12:14, 25 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 each wiki user's language setting 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 some basic steps are necessary:

  • Import a language switcher
  • Create wiki pages with linked translation subpages


In addition, depending on your wiki setup, further aspects can and should be considered:

  • Create page lists for each language with different filter settings
  • Create portal pages based on user language
  • Create template and form labels based on user language
  • Create a multilingual category system
  • Create multilingual navigation links


The following information gives you some suggestions for 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.

Importing the 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. The techniques shown in the following sections assume that this language switcher is installed.

Be sure to read the configuration instructions on the downloads page. You need to define the languages that you want to support in the template.

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

Creating wiki pages with translated subpages

Let's take a page called Vacation policy and create a German language version as a subpage. After saving the page Vacation policy/de and providing the content translation, we have the German translation that we wanted. As you can see in the screenshots below, the page content 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, but actually supports the user when navigating the wiki.

Adding the language switcher to a page

Now that we have two language versions, we want to connect them. with the language switcher. 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).
    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.
  4. Save the page.
  5. Repeat steps 1-4 with other language subpages (e.g, fr, nl).


The language switcher now indicates directly on a page if and what other languages are already available for that page.

Language switcher shows all available translations
The language switcher shows all available translations

Creating page lists for different languages

Over time, a wiki can have lots of these translated pages. We want to make sure that users know what pages are available in what languages. For this purpose, the language switcher template includes a custom property Languages/tracklang that allows to easily create filtered page lists for this purpose.

Working with properties requires the Semantic MediaWiki extensions, which are bundled in BlueSpice pro, but not in BlueSpice free. There are, however, alternative approaches for creating page lists in BlueSpice free.

In BlueSpice pro, you can include different inline queries on any wiki page. This example lists German language pages in the main namespace and displays them in a category-type output (A-Z listing):

{{#ask:
[[:+]][[Languages/tracklang::de]]
|format=category
}}
Results format "category"
Results format "category"

Explanation of the arguments for this query:

  • [[:+]]: Returns pages only in the main namespace. To show the pages form the entire wiki, simply delete this argument.
    • [[QM::+]]: Returns pages from the namespace QM
    • [[QM:+||Help:+]]: Returns pages from the namespaces QM and Help.
  • [[Languages/tracklang::de]]: Returns only pages that are marked by the language switcher template as German language pages. Other options:
    • [[Languages/tracklang::+]]: Returns all language pages that are tracked in the wiki by the language switcher template.
    • [[Languages/tracklang::!de]]: Returns all language pages except German pages.
    • [[Languages/tracklang::de||fr]]: Returns all language pages in German and French (in the example above restricted to the main namespace.
  • format=category: returns a category style output.
    • format=ul: returns a list style output
Results format "ul"
Results format "ul"


To see more examples for how to define and further modify a query for creating page lists, go to our SMW-query examples page.

Creating portal pages based on user language settings

Portal pages are pages that serve as entry points to different topics or areas in the portal, often considering the needs of specific user groups. A typical example is the main page of the wiki, which is often used to give users a high-level orientation in the wiki. A portal page is a good place to also consider the language needs of different users.

Here, we can take two different approaches:

  1. Provide the same page to all users, but include some content that targets specific user languages.
  2. Provide completely separate content to users based on their user language.

What is the user language?

Wiki users can change their own language setting in the user preferences:

User language preference
User language preference

Depending on this setting, users then see the user interface elements in that language as we have seen in previous screenshots.

Multilingual navigation

Currently, there is no easy mechanism to create multilingual navigation menus, such as the main navigation or the custom menu. More support should be coming in one of the next minor releases of BlueSpice (4.1.3 or 4.1.4). In the meantime, you can create individual links based on a user's language settings.

Alternative solutions in BlueSpice free



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

Discussions