Help:Add language bar

From Free Pascal wiki
Revision as of 12:20, 1 October 2009 by Kavomsk (talk | contribs) (→‎Overview)
Jump to navigationJump to search


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. 111

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.

Adding the language bar

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

  • To the top of the page add {{Lazarus DB Faq}}. This adds a link to the template page.
  • Save the page.
  • Go again to the editing page. Now you see the text "Templates used on this page: Template:Lazarus DB Faq" with a link to a (non-existing) template page. Click on it to and start edit the template.
  • Add the following content to the template page.
[[Lazarus DB Faq/de|'''Deutsch (de)''']] 
[[Lazarus DB Faq | '''English (en)''']]
  • Add an entry for each translation. See for names the Main Page template, because that probably has the most translations.
  • Save the template page.
  • Now go to each translated page (in this case Lazarus DB Faq/de) and add {{Lazarus DB Faq}} to the top of the page.

Updating the language bar

Edit the template page, so that the new translation is added.

  • 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.