Jump to content

Template:Lang-zh/doc: Difference between revisions

From Noumenapedia
→TemplateData: more china-relevant example
 
m 1 revision imported
 
(No difference)

Latest revision as of 15:05, 9 September 2026

__EXPECTED_UNCONNECTED_PAGE__

This is a unified template for displaying various varieties of Chinese, in various orthographies. It can display (and link to): both simplified and traditional Chinese characters; literal translation; Zhuyin (Bopomofo); the Hanyu Pinyin, Tongyong Pinyin, and Wade–Giles romanizations of Mandarin; the Jyutping, Yale, and Sidney Lau romanizations of Cantonese; and the Pe̍h-ōe-jī and Tâi-lô romanizations of Hokkien. It supports ordering and formatting the output for different use cases.

Usage

Parameters

To use the template, start with {{Lang-zh}} and add any parameters you like, along with what you want to be displayed. The template will display all, and only, the parameters that you give it. The following parameters are supported:

Parameter Description Example
<syntaxhighlight lang="wikitext" inline style="display: none;" />|t=
or <syntaxhighlight lang="wikitext" inline style="display: none;" />|t_hk=
or <syntaxhighlight lang="wikitext" inline style="display: none;" />|t_tw=[1]
traditional Chinese[2] {{Lang-zh|t=中國}}
Chinese: 中國
<syntaxhighlight lang="wikitext" inline style="display: none;" />|s= simplified Chinese[2] {{Lang-zh|s=中国}}
Chinese: 中国
<syntaxhighlight lang="wikitext" inline style="display: none;" />|c=[3] Chinese (here simplified forms) {{Lang-zh|c=中国}}
Chinese: 中国
<syntaxhighlight lang="wikitext" inline style="display: none;" />|p= or <syntaxhighlight lang="wikitext" inline style="display: none;" />|hp= pinyin[4] Mandarin {{Lang-zh|p=Zhōngguó}}
pinyin: Zhōngguó
<syntaxhighlight lang="wikitext" inline style="display: none;" />|tp= Tongyong Pinyin {{Lang-zh|tp=Jhongguó}}
Tongyong Pinyin: Jhongguó
<syntaxhighlight lang="wikitext" inline style="display: none;" />|w= Wade–Giles[5] {{Lang-zh|w=Chung1kuo2}}
Wade–Giles: Chung1kuo2
<syntaxhighlight lang="wikitext" inline style="display: none;" />|j= Jyutping[6] Cantonese {{Lang-zh|j=Gwong2zau1}}
Jyutping: Gwong2zau1
<syntaxhighlight lang="wikitext" inline style="display: none;" />|cy= Cantonese Yale {{Lang-zh|cy=Gwóngjāu}}
Cantonese Yale: Gwóngjāu
<syntaxhighlight lang="wikitext" inline style="display: none;" />|sl= Sidney Lau[5] {{Lang-zh|sl=Gwong2jau1}}
Sidney Lau: Gwong2jau1
<syntaxhighlight lang="wikitext" inline style="display: none;" />|poj= Pe̍h-ōe-jī Hokkien {{Lang-zh|poj=Tâi-tiong-koān}}
Pe̍h-ōe-jī: Tâi-tiong-koān
<syntaxhighlight lang="wikitext" inline style="display: none;" />|tl= Tâi-lô {{Lang-zh|tl=Tâi-tiong-kuān}}
Tâi-lô: Tâi-tiong-kuān
<syntaxhighlight lang="wikitext" inline style="display: none;" />|zhu= Zhuyin Fuhao {{Lang-zh|zhu=ㄊㄠˊ ㄩㄢˊ ㄒㄧㄢˋ}}
Zhuyin Fuhao: ㄊㄠˊ ㄩㄢˊ ㄒㄧㄢˋ
<syntaxhighlight lang="wikitext" inline style="display: none;" />|l= literal meaning {{Lang-zh|l=Middle Kingdom}}
lit. 'Middle Kingdom'
<syntaxhighlight lang="wikitext" inline style="display: none;" />|tr= translation {{Lang-zh|tr=China}}
trans. "China"
<syntaxhighlight lang="wikitext" inline style="display: none;" />|labels= Display language labels See below
<syntaxhighlight lang="wikitext" inline style="display: none;" />|links= Display language links See below
<syntaxhighlight lang="wikitext" inline style="display: none;" />|first= Override default ordering See below
<syntaxhighlight lang="wikitext" inline style="display: none;" />|scase= Use sentence case See below
<syntaxhighlight lang="wikitext" inline style="display: none;" />|out= Choose a parameter to display outside of brackets See below
  1. ↑ Use <syntaxhighlight lang="wikitext" inline style="display: none;" />|t_hk= or <syntaxhighlight lang="wikitext" inline style="display: none;" />|t_tw= to specify an orthographic variant if needed. See this image for an example.
  2. ↑ 2.0 2.1 If <syntaxhighlight lang="wikitext" inline style="display: none;" />|s= and <syntaxhighlight lang="wikitext" inline style="display: none;" />|t= are both given and are the same – i.e. the simplified and traditional characters are identical – then they only appear once: {{Lang-zh|s=北京|t=北京}} gives Chinese: 北京.
  3. ↑ If only one unnamed parameter is given, it will be treated as if it were passed to <syntaxhighlight lang="wikitext" inline style="display: none;" />|c=.
  4. ↑ This will display as "Hanyu Pinyin", instead of just "pinyin", if Tongyong Pinyin is also included in the template; this way the two types of pinyin contrast and neither is treated as a "default".
  5. ↑ 5.0 5.1 Wade-Giles and SidneyLau romanizations use superscripted numbers for tones. The template automatically converts unsuperscripted tone numbers to superscripted ones.
  6. ↑ Can be automatically generated: {{kCantonese|廣州}} → gwong2 zau1

Label options

Add <syntaxhighlight lang="wikitext" inline style="display: none;" />|labels=no anywhere in the template to disable labels, so only the text supplied as parameters appears, separated by semicolons. This minimises the length of the template, and can be used when the template is used more than once to lessen its impact. Disabling labels also suppresses links.

{{Lang-zh|t=中國|s=中国|hp=Zhōngguó|tp=Jhongguó|labels=no}}
中国; 中國; Zhōngguó; Jhongguó

Add <syntaxhighlight lang="wikitext" inline style="display: none;" />|links=no anywhere in the template to suppress label links. This is for preventing overlinking in an article or section where the template is used repeatedly.

{{Lang-zh|t=中國|s=中国|hp=Zhōngguó|tp=Jhongguó|links=no}}
simplified Chinese: 中国; traditional Chinese: 中國; Hanyu Pinyin: Zhōngguó; Tongyong Pinyin: Jhongguó

Add <syntaxhighlight lang="wikitext" inline style="display: none;" />|scase=yes anywhere in the template to use sentence case, so the first label starts with a capital letter. This allows the template to be used at the start of a sentence for example.

{{Lang-zh|t=中國|s=中国|hp=Zhōngguó|tp=Jhongguó|scase=yes}}
Simplified Chinese: 中国; traditional Chinese: 中國; Hanyu Pinyin: Zhōngguó; Tongyong Pinyin: Jhongguó

Ordering

The template can be given more than one value (for example, on the article China, it has s, t, hp, tp, and w). By default, when multiple parameters are given they will be shown in the same order as the above table: first Chinese characters (simplified, then traditional), then romanizations (starting with Hanyu and Tongyong Pinyin).

This order can be overridden (for example for Hong Kong and Taiwan topics), using <syntaxhighlight lang="wikitext" inline style="display: none;" />|first=. It accepts a comma delimited list of values, out of the following:

  • <syntaxhighlight lang="wikitext" inline style="display: none;" />|first=t puts traditional characters before simplified characters
  • <syntaxhighlight lang="wikitext" inline style="display: none;" />|first=j puts the Cantonese romanizations (Jyutping, Yale, and Sidney Lau) before Mandarin and Hokkien romanizations
  • <syntaxhighlight lang="wikitext" inline style="display: none;" />|first=poj puts Hokkien romanizations (POJ and Tâi-lô) before Mandarin and Cantonese romanizations

They can be combined in any order, for example: <syntaxhighlight lang="wikitext" inline style="display: none;" />|first=j,t or <syntaxhighlight lang="wikitext" inline style="display: none;" />|first=t,j

Examples:

{{Lang-zh|t=臺北|s=台北|hp=Táiběi}}
simplified Chinese: 台北; traditional Chinese: 臺北; pinyin: Táiběi
{{Lang-zh|t=臺北|s=台北|hp=Táiběi|first=t}}
traditional Chinese: 臺北; simplified Chinese: 台北; pinyin: Táiběi
{{Lang-zh|t=九龍|s=九龙|p=Jiǔlóng|j=gau2lung4}}
simplified Chinese: 九龙; traditional Chinese: 九龍; pinyin: Jiǔlóng; Jyutping: gau2lung4
{{Lang-zh|t=九龍|s=九龙|p=Jiǔlóng|j=gau2lung4|first=t, j}}
traditional Chinese: 九龍; simplified Chinese: 九龙; Jyutping: gau2lung4; pinyin: Jiǔlóng

It is also possible to override the default ordering for an entire article, so all uses of the template default to <syntaxhighlight lang="wikitext" inline style="display: none;" />|first=t (traditional characters before simplified characters). This is done by adding the article to the list t1st at the top of Module:Lang-zh, following the formatting of the articles already there. The module is edit-protected, so you may need to use {{edit template-protected}} on the module's talk page Module talk:Lang-zh to request an article is added, if you cannot add it yourself.

Bracketing

<syntaxhighlight lang="wikitext" inline style="display: none;" />|out= can be used to place a supplied parameter outside brackets, with the remainder placed within them. This is useful when a particular aspect of the text is being read inline or emphasized. If both <syntaxhighlight lang="wikitext" inline style="display: none;" />|s= and <syntaxhighlight lang="wikitext" inline style="display: none;" />|t= are specified, and <syntaxhighlight lang="wikitext" inline style="display: none;" />|out=c, both sets of characters will be placed outside the brackets.

Examples:

{{Lang-zh|t=馬來西亞|s=马来西亚|hp=Mǎláixīyà|tr=Malaysia|labels=no|out=tr}}
"Malaysia" (马来西亚; 馬來西亞; Mǎláixīyà)
{{Lang-zh|t=馬來西亞|s=马来西亚|hp=Mǎláixīyà|tr=Malaysia|labels=no|out=c}}
马来西亚; 馬來西亞 (Mǎláixīyà; "Malaysia")
{{Lang-zh|t=可口可樂|s=可口可乐|p=Kěkǒu Kělè|tr=[[Coca-Cola]]|labels=no|out=p}}
Kěkǒu Kělè (可口可乐; 可口可樂; "Coca-Cola")

TemplateData

Tracking categories

See also

Aliases

Similar templates

Inline templates for marking up Chinese characters
Template Languages Scripts Transliterations Translation Labels
{{Hani}} Any N/a N/a No No
{{CJKV}} Yes Always
{{lang-zh}} Chinese
  • Traditional Chinese
  • Simplified Chinese
Yes Optional
{{Nihongo}} Japanese Japanese writing system[a] Hepburn Yes Optional
{{Nihongo2}} Japanese Japanese writing system[a] N/a No No
{{Korean}} Korean
Yes Optional
{{Hanja}} Korean Hanja N/a No Always
{{Vi-nom}} Vietnamese Chữ Nôm N/a No No
{{Lang}} Any Any Any No No
{{Langx}} Any Any Any Yes Optional
  1. ↑ 1.0 1.1 1.2 No parameter for giving a kana transcription; mixed orthography can be used.
  2. ↑ A single "Korean" parameter—suitable for giving a Hangul transcription of a written word used in multiple languages, but not transcribing hanja in a Korean-specific context.
  3. ↑ A single "Vietnamese" parameter—suitable for giving a transcription of a written word used in multiple languages, but not transcribing in a Vietnamese-specific context.