Difference between revisions of "Help:Add language bar/zh CN"

From Lazarus wiki
Line 1: Line 1:
{{Add language bar条}}

Revision as of 04:58, 20 November 2018



This page describes how a language bar can be added to translated - and original - pages. The language bar helps users to see, what translations are available. If he comes to an English page through a search engine, he can see immediately, if the page is available in his own language too.

Templates are used to reduce maintenance if a page gets a new translation. The translated page only needs to be added to the template and it will be available on all (translated) pages that use the template.

See for example adding the language bar to the Lazarus DB Faq page.


This instruction describes adding the language bar to the Lazarus DB Faq page.

  • Edit the page by using the link "Edit" on the VIEWS panel.
  • To the top of the page add {{Lazarus DB Faq}}. This adds a link to the template page.
  • Save the page. You will see at the top: Template:Lazarus DB Faq highlighted in red.
  • 再次编辑页。 Scroll down to the bottom of page and you'll see the text "Templates used on this page: Template:Lazarus DB Faq" with a link to a (non-existing) template page. Click on it and this will show an empty template page, Edit the page using the "Edit" link on VIEWS panel and start to edit the template
  • Add the following content to the template page.
[[Lazarus DB Faq/de|'''{{#language:de}} (de)''']] 
[[Lazarus DB Faq | '''{{#language:en}} (en)''']]
The country code in the {{language:xx}} parameter is defined in ISO 639.
  • Add an entry for each translation. See for names the Main Page template, because that probably has the most translations. Note the "Lazarus DB Faq" is case sensitive.
  • 保存template页.
  • Now go to each translated page (in this case Lazarus DB Faq/de) and add {{Lazarus DB Faq}} to the top of the page.



  • Go the edit tab of a page that has a new translation.
  • On the edit page you find a link to the used template. Click on it, to show it.
  • Edit the template page and add a link to the new translation.


Put the template {{MenuTranslate| page=Your_page}} on top of every new page (original or translated). This template searches the wiki for any translated pages to a given original. So you don't have to change a template by yourself.


查看: Template: MenuTranslate


There seems to be a minor flaw somewhere in the template. But if somebody could fix this, it is probably an easier, cleaner and more elegant way to add a language bar.