Manual:Extension/BlueSpiceDiscovery/Main navigation/Language support: Difference between revisions

(Created page with " == Support for the user language settings == If you want to make sure that your menu items are shown in the language a user has set under their ''Preferences'', you need to p...")
Tag: 2017 source edit
 
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:


== Support for the user language settings ==
== Navigation based on the user language setting ==
If you want to make sure that your menu items are shown in the language a user has set under their ''Preferences'', you need to provide a separate message page for each menu item. These message pages need to reside in the namespace ''MediaWiki''. Since BlueSpice supports English and German (both de and de-formal), you need three language pages for each menu item in the sidebar.
{{Messagebox|boxtype=note|icon=|Note text=These instructions do not apply in a farm environment or in separate language wikis. These instructions are used for maintaining languages in as single wiki.|bgcolor=}}


In the following example, we create a menu item called ''Quality assurance.'' A user who specified German (de) or formal German (de-formal in their preferences, should see the label ''Qualitätssicherung'' instead.
=== Link labels ===
If you want the link labels in the main navigation or the [[Manual:Extension/CustomMenu|custom menu]] to match the language a user has set under their ''Preferences'', you need to provide a separate system message page for each menu item. These message pages need to be created in the namespace ''MediaWiki''.
 
In the following example, we create a menu item called ''Quality assurance.'' A user who specified German (de) or formal German (de-formal) in their preferences, should see the label ''Qualitätssicherung'' instead.


'''To create the labels in EN, DE and DE-formal:'''
'''To create the labels in EN, DE and DE-formal:'''


#Create or edit the page ''MediaWiki:QA'' and add the text for the English label (''Quality assurance'').Save the page.
#'''Create'''  the page ''MediaWiki:QA'' and add the text for the English label (''Quality assurance'').Save the page.
#Create or edit the page ''MediaWiki:QA''/''de'' and add the text for the German label (''Qualitätssicherung'').Save the page.
#'''Create'''  the page ''MediaWiki:QA''/''de'' and add the text for the German label (''Qualitätssicherung''). Save the page.
#Create or edit the page ''MediaWiki:QA''/''de-formal'' and add the text for the German label (''Qualitätssicherung''). Save the page.
#'''Create''' a link on the page ''MediaWiki:Sidebar'': <code>**About_quality_assurance|QA</code>   This creates a link in the main navigation to the page ''About quality assurance'' and displays the label that is defined in the different language message pages for the message "QA". To test the languages, go to ''Preferences > User Profile'' in your user profile menu. In the section ''Internationalisation'', set the language from English to German or vice versa and save the setting. The language of the menu item now displays in the correct language.
#Create the link on the page ''MediaWiki:Sidebar'': <code>**About_quality_assurance|QA</code> This creates a link in the main navigation to the page ''About quality assurance'' and displays the label that is located in the different language message pages. To test the languages, go to ''Preferences > User Profile'' in your user profile menu. In the section ''Internationalisation'', set the language from English to German or vice versa and save the setting. The language of the menu item now displays in the correct language.


==<span class="mw-headline">Navigation in multilingual wikis</span>==
===<span class="mw-headline">Link targets</span>===
{{Messagebox|boxtype=important|Note text=These instructions do not apply in a farm environment or in separate language wikis. These instructions are used for maintaining languages via sub-pages.}}
If you have content in multiple languages, you want that users with English language preference settings not only see the corresponding menu labels. They should also be directed to an English page when they click on a menu item. Users with German language settings should see the German content after clicking on the German menu link. In this case, you also have to create separate link targets in addition to the language labels.


If you have content in multiple languages, you want that users with English language preference settings not only see the corresponding menu labels. They should also be directed to the English page when they click on a menu item. Users with German language settings should see the German content after clicking on the German menu link. In this case, you also have to create separate link targets in addition to the language labels.<div>
In the previous section, we already created the labels when a user switches languages. Now we also have to create different link targets for these pages. If the main language is English and the page is called ''About quality assurance,'' the translations can be located in subpages. For example, the German version is located under ''About quality assurance/de''.
{{Messagebox|boxtype=note|Note text=To avoid having to set up different navigation pages for formal (de-formal) and informal German (de), you can create a policy, which language setting should be used by your users.}}
</div>In the previous section, we already created the labels when a user switches languages. Now we also have to create different link targets for these pages. If the main language is English and the page is called ''About quality assurance,'' the translations can be located in subpages. For example, the German version is located under ''About quality assurance/de''.


'''To create the link targets to the language pages:'''
'''To create the link targets to the language pages:'''


#Create or edit the page ''MediaWiki:QA-url'' and add the link to the English page ''About quality assurance''. The link is entered without brackets, in plain text. Save the page.
#'''Create''' the page ''MediaWiki:QA-url'' and add the link to the English page ''About quality assurance''. The link is entered without brackets, in plain text. Save the page.
#Create or edit the page ''MediaWiki:QA''-url/''de'' and add the text for the German page (''About quality assurance''/de). The link is entered without brackets, in plain text. Save the page.
#'''Create''' the page ''MediaWiki:QA''-url/''de'' and add the text for the German page (''About quality assurance''/de). The link is entered without brackets, in plain text. Save the page.
#Create or edit the page ''MediaWiki:QA''-url/''de-formal'' and add the text for the German page (''About quality assurance''/de). The link is entered without brackets, in plain text. Save the page.


In the link to the ''Quality assurance'' page, change the link from
In the navigaion link to the ''Quality assurance'' page, change the link from


<code>**About_quality_assurance|QA</code>
<code>**About_quality_assurance|QA</code>
Line 33: Line 32:
<code>**QA-url|QA</code>
<code>**QA-url|QA</code>


This achieves the language switch for the target pages (QA-url) and for the label of the menu item.
This achieves the language switch for the target pages (QA-url) and for the label (QA) of the menu item.


Depending on the language settings of the user, the user is now directly directed to the correct language version.
Depending on the language settings of the user, the user is now directly directed to the correct language version.
{{Box Links-en|Topic1=[[Manual:Extension/BlueSpiceInterWikiLinks|Interwikilinks]]}}
[[Category:Multilingual wiki]]

Latest revision as of 16:14, 30 March 2022

Navigation based on the user language setting

Note:These instructions do not apply in a farm environment or in separate language wikis. These instructions are used for maintaining languages in as single wiki.


Link labels

If you want the link labels in the main navigation or the custom menu to match the language a user has set under their Preferences, you need to provide a separate system message page for each menu item. These message pages need to be created in the namespace MediaWiki.

In the following example, we create a menu item called Quality assurance. A user who specified German (de) or formal German (de-formal) in their preferences, should see the label Qualitätssicherung instead.

To create the labels in EN, DE and DE-formal:

  1. Create the page MediaWiki:QA and add the text for the English label (Quality assurance).Save the page.
  2. Create the page MediaWiki:QA/de and add the text for the German label (Qualitätssicherung). Save the page.
  3. Create a link on the page MediaWiki:Sidebar: **About_quality_assurance|QA This creates a link in the main navigation to the page About quality assurance and displays the label that is defined in the different language message pages for the message "QA". To test the languages, go to Preferences > User Profile in your user profile menu. In the section Internationalisation, set the language from English to German or vice versa and save the setting. The language of the menu item now displays in the correct language.

Link targets

If you have content in multiple languages, you want that users with English language preference settings not only see the corresponding menu labels. They should also be directed to an English page when they click on a menu item. Users with German language settings should see the German content after clicking on the German menu link. In this case, you also have to create separate link targets in addition to the language labels.

In the previous section, we already created the labels when a user switches languages. Now we also have to create different link targets for these pages. If the main language is English and the page is called About quality assurance, the translations can be located in subpages. For example, the German version is located under About quality assurance/de.

To create the link targets to the language pages:

  1. Create the page MediaWiki:QA-url and add the link to the English page About quality assurance. The link is entered without brackets, in plain text. Save the page.
  2. Create the page MediaWiki:QA-url/de and add the text for the German page (About quality assurance/de). The link is entered without brackets, in plain text. Save the page.

In the navigaion link to the Quality assurance page, change the link from

**About_quality_assurance|QA

to

**QA-url|QA

This achieves the language switch for the target pages (QA-url) and for the label (QA) of the menu item.

Depending on the language settings of the user, the user is now directly directed to the correct language version.

Related info




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

Discussions