Template:LC zh
| Uses Lua: |
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
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
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Output language/language variant | lang | The language/language variant to output. ("zh-hans", "zh-hans", "zh-hk")
| String | optional |
| 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".
| Boolean | optional |
| Content type | type | The content type, values: "N" - Namespace names, "T" - Page display title, "H" - Section heading, "C" - Text content. Aliases: "1".
| String | required |
| English canonical namespace name | ns | (type = N, T) The canonical name of the namespace in English. Aliases: "3", "namespace".
| String | optional |
| 2nd English canonical namespace name | ns_2 | (type = N, T) The canonical name of the secondary pseudo-namespace in English. For example, "Extension" in "Help:Extension:Example".
| String | optional |
| Mandarin - Simplified Han script | zh-hans | The text content in Mandarin - Simplified Han script.
| Content | suggested |
| Mandarin - Traditional Han script | zh-hant | The text content in Mandarin - Traditional Han script.
| Content | suggested |
| Mandarin - Traditional Han script, Hong Kong | zh-hk | The text content in Mandarin - Traditional Han script, Hong Kong.
| Content | optional |