(Changed categories.) |
No edit summary |
||
Line 57: | Line 57: | ||
** <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. To see more | * format=category: returns a category style output. | ||
** format=ul: returns a list style output | |||
To see more query examples, go to our [[SMW queries|SMW-query examples]] page. | |||
[[Category:Multilingual wiki]] | [[Category:Multilingual wiki]] |
Revision as of 16:02, 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:
- Import a language switcher
- 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 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.
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.
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).The search engine will index this display title so that the title search returns the expected result.
- Save the page.
- Repeat steps 1-4 with the other language subpages.
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.
Page lists for different languages
The language switcher templates includes a custom property Languages/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):
{{#ask:
[[:+]][[Languages/tracklang::de]]
|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
To see more query examples, go to our SMW-query examples page.