Шаблон:Category

Матеріал з Terraria Wiki
Перейти до навігації Перейти до пошуку
Цей шаблон i18n-ready, що означає, що його легко локалізувати для різних мов. Будь ласка, ознайомтеся з i18n та l10n для шаблонів, щоб дізнатися більше.
Template-info.svg Документація Наведена нижче документація запозичена з «Шаблон:Category/док». (редагувати | історія)
Для більш повної чи актуальної інформації ви можете переглянути документацію англійською.

This template is roughly an i18n-ready version of the [[Category:]] syntax. It is intended to be used in template documentation for easier porting to language wikis.

Usage

{{ category | <category name (English)> | <sort key> (optional) | lang = <language code> (optional) }}

First unnamed parameter

Name of the category.

Second unnamed parameter

Sort key for the page. The blank sort key is supported (for that, the parameter value must consist only of whitespace).

lang

Target language, defaults to {{lang|}}.

Notes

This template will try to localize $1 (the category name) and $2 (the sort key) in the following way:

  1. If $lang is a language within the main wiki (e.g. cs, it, ...), then the language code will simply be appended to $1 (including a slash character), and $2 will not be localized.
  2. If $lang is a language with its own wiki (e.g. de, zh, ...):
    1. $1 and $2 will be translated according to the glossary defined in Template:Category/db-<lang>, e.g. Template:Category/db-zh for Chinese.
    2. If there is no definition in the glossary, $1 and $2 will be translated via {{tr}}.
Note that a language's glossary is loaded once per page. Subsequent template calls will reuse it, even if their $lang parameter is different.

Examples

Code Result
{{category|Navigational templates}} [[Category:Шаблони навігації ]]
{{category|Navigational templates|Wood}} [[Category:Шаблони навігації|Деревина ]]
{{category|Navigational templates|}} [[Category:Шаблони навігації| ]]
{{category|Navigational templates|Wood|lang=it}} [[Category:Navigational templates/it|Wood ]]
{{category|Navigational templates|Wood|lang=de}} [[:Шаблон:Category/db-de]][[Category:Шаблони навігації|<strong class="error"><span class="scribunto-error" id="mw-scribunto-error-0">Помилка Lua у package.lua у рядку 80: module 'Module:Tr/loaddata-de' not found.</span></strong>Wood ]]