Jump to content

Template:LC zh

Permanently protected template
From Meta, a Wikimedia project coordination wiki
Template documentation
 
Other languages:

Description

This template handles the language conversion ("LC") for Mandarin ("zh") page titles and content, especially for page titles with/without namespace names (the "nsp" parameter), content across language converter and non-language-converter pages.

Usage

The usage is different in each content types.

N - Namespace names

Namespace name-only:

  • {{LC zh|lang = {{{lang|}}}|hide_ns = {{{nsp|}}}|type = N|ns = <namespace name in en>}}

Containing pseudo namespace name:

  • {{LC zh|lang = {{{lang|}}}|hide_ns = {{{nsp|}}}|type = N|ns = <namespace name in en>|ns_2 = <pseudo namespace name in en>}}

Example:

  • {{LC zh|lang = {{{lang|}}}|hide_ns = {{{nsp|}}}|type = N|ns = Help}} → Help
  • {{LC zh|lang = {{{lang|}}}|hide_ns = {{{nsp|}}}|type = N|ns = Help|ns_2 = Extension}} → Help:Extension

T - Page display title

For page titles in main namespace:

  • {{LC zh|lang = {{{lang|}}}|hide_ns = {{{nsp|}}}|type = T|ns = |zh-hans = <zh-Hans page name>|zh-hant = <zh-Hant page name>}}

For page titles containing namespace name:

  • {{LC zh|lang = {{{lang|}}}|hide_ns = {{{nsp|}}}|type = T|ns = <namespace name in en>|zh-hans = <zh-Hans page name>|zh-hant = <zh-Hant page name>}}
  • {{LC zh|lang = {{{lang|}}}|hide_ns = {{{nsp|}}}|type = T|ns = <namespace name in en>|zh-hans = <zh-Hans page name>|zh-hant = <zh-Hant (zh-Hant-TW) page name>|zh-hk = <zh-Hant-HK page name>}}

For page titles containing pseudo namespace name:

  • {{LC zh|lang = {{{lang|}}}|hide_ns = {{{nsp|}}}|type = T|ns = <namespace name in en>|ns_2 = <pseudo namespace name in en>|zh-hans = <zh-Hans page name>|zh-hant = <zh-Hant page name>}}
  • {{LC zh|lang = {{{lang|}}}|hide_ns = {{{nsp|}}}|type = T|ns = <namespace name in en>|ns_2 = <pseudo namespace name in en>|zh-hans = <zh-Hans page name>|zh-hant = <zh-Hant (zh-Hant-TW) page name>|zh-hk = <zh-Hant-HK page name>}}

Example:

  • {{LC zh|lang = {{{lang|}}}|hide_ns = {{{nsp|}}}|type = T|ns = Project|zh-hans = 关于|zh-hant = 關於}} → Project:关于

H - Section headings

Headings can automatically generate multiple anchors for different language variants.

  • == {{LC zh|lang = {{{lang|}}}|type = H|zh-hans = <zh-Hans section heading>|zh-hant = <zh-Hant section heading>}} ==
  • == {{LC zh|lang = {{{lang|}}}|type = H|zh-hans = <zh-Hans section heading>|zh-hant = <zh-Hant section heading>|zh-hk = <zh-Hant-HK page section heading>}} ==

Example:

  • == {{LC zh|lang = {{{lang|}}}|type = H|zh-hans = 关于|zh-hant = 關於}} == → == 关于 ==

C - Content

  • {{LC zh|lang = {{{lang|}}}|type = C|zh-hans = <zh-Hans content>|zh-hant = <zh-Hant content>}}
  • {{LC zh|lang = {{{lang|}}}|C|zh-hans = <zh-Hans content>|zh-hant = <zh-Hant (zh-Hant-TW) content>|zh-hk = <zh-Hant-HK content>}}

Example:

  • {{LC zh|lang = {{{lang|}}}|type = C|zh-hans = 关于|zh-hant = 關於}} → 关于

Integration with other templates and modules

Template data

This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools.

TemplateData for LC zh

Language conversion template for Mandarin namespace names, page display titles, section headings and content. Only support zh-hans, zh-hant, zh-hk

Template parameters[Edit template data]

ParameterDescriptionTypeStatus
Output language/language variantlang

The language/language variant to output. ("zh-hans", "zh-hans", "zh-hk")

Example
zh-hant
Auto value
{{{lang|}}}
Stringoptional
Hide namespace prefixes?hide_ns

(type = N, T) Whether to hide the namespace prefix (only apply to parameter "ns", does not affect parameter "ns_2"). Value is passed from the "nsp" parameter of [[Template:Localized link]]. Aliases: "2", "nsp".

Example
1
Auto value
{{{nsp|}}}
Booleanoptional
Content typetype

The content type, values: "N" - Namespace names, "T" - Page display title, "H" - Section heading, "C" - Text content. Aliases: "1".

Example
T
Auto value
C
Stringrequired
English canonical namespace namens

(type = N, T) The canonical name of the namespace in English. Aliases: "3", "namespace".

Example
Help
Stringoptional
2nd English canonical namespace namens_2

(type = N, T) The canonical name of the secondary pseudo-namespace in English. For example, "Extension" in "Help:Extension:Example".

Example
Extension
Stringoptional
Mandarin - Simplified Han scriptzh-hans

The text content in Mandarin - Simplified Han script.

Default
{{{zh-hant|{{{zh-hk|}}}}}}
Example
Example_zh-Hans
Contentsuggested
Mandarin - Traditional Han scriptzh-hant

The text content in Mandarin - Traditional Han script.

Default
{{{zh-hk|{{{zh-hans|}}}}}}
Example
Example_zh-Hant
Contentsuggested
Mandarin - Traditional Han script, Hong Kongzh-hk

The text content in Mandarin - Traditional Han script, Hong Kong.

Default
{{{zh-hant|{{{zh-hans|}}}}}}
Example
Example_zh-Hant-HK
Contentoptional
Edit parameter translations

Tracking categories