Template:Category/doc

From Infernum Mod Wiki
Jump to navigation Jump to search

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 not English but on-wiki[1], then the language code will simply be appended to $1 (including a slash character), and $2 will not be localized.
  2. If $lang is English then it will simply add the page to the category.

Examples

Code Result
{{category|Navigational templates}} [[Category:Navigational templates ]]
{{category|Navigational templates|Wood}} [[Category:Navigational templates|Wood ]]
{{category|Navigational templates|}} [[Category:Navigational templates| ]]
{{lang/set|ru}}
{{category|Navigational templates}} [[Category:Шаблоны навигации ]]
{{category|Navigational templates|Wood|lang=zh}} [[Category:Navigational templates/zh|Wood ]]

Footnotes

  1. Chinese (zh)