Help:Add language bar/zh CN

From Lazarus wiki
Jump to navigationJump to search

Deutsch (de) English (en) español (es) suomi (fi) français (fr) magyar (hu) 日本語 (ja) 한국어 (ko) polski (pl) português (pt) русский (ru) slovenčina (sk) 中文(中国大陆) (zh_CN)

概述

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.
  • 在页的顶部添加{{Lazarus DB Faq}}. This adds a link to the template 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.
{{LanguageBar}}<includeonly>{{CategoriesBySuffixForPage
|FPC|Lazarus|Databases}}</includeonly>
  • 保存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.

升级语言栏

编辑template页,所以新的翻译被添加。

  • 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:LanguageBar

注释

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.