Cithakan:Lang-zh
Nganggo Lua: |
This template is used on 50.000 pages, so changes to it will be widely noticed. Please test any changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Please consider discussing changes on the talk page before implementing them. |
Templat ini tidak boleh digunakan dalam templat kutipan seperti Citation Style 1 dan Citation Style 2, karena menyertakan markah yang akan mencemari metadata COinS yang mereka hasilkan; lihat Wikipedia:COinS. |
About
[besut sumber]There were once a large number of Chinese Romanization templates, including:
- {{zh-stp}} could display simplified and traditional characters and Hanyu Pinyin
- {{zh-cpwl}} could display general Han characters, pinyin and Wade–Giles, and literal translations
- {{zh-full}} and its sub-templates allowed more control over display order
This template was created to combine these into one template with all needed functionality. It can display (and link to) general, simplified, or traditional Han characters; literal translation; Zhuyin (Bopomofo); and the Hanyu Pinyin, Tongyong Pinyin, Wade–Giles, Jyutping, Cantonese Yale, Sidney Lau and Pe̍h-ōe-jī romanizations. It supports reordering the output for the most commonly used orders (other orderings can easily be added).
Usage
[besut sumber]Parameters
[besut sumber]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 |
---|---|---|
|t= |
traditional Chinese[1] | {{Lang-zh|t=中國}} Masalah Lua ing package.lua larik 80: module 'Modul:No globals' not found. |
|s= |
simplified Chinese[1] | {{Lang-zh|s=中国}} Masalah Lua ing package.lua larik 80: module 'Modul:No globals' not found. |
|c= [2] |
Chinese (in simplified typeface) | {{Lang-zh|c=中国}} Masalah Lua ing package.lua larik 80: module 'Modul:No globals' not found. |
|p= or |hp= |
pinyin[3] | {{Lang-zh|p=Zhōngguó}} Masalah Lua ing package.lua larik 80: module 'Modul:No globals' not found. |
|tp= |
Tongyong Pinyin | {{Lang-zh|tp=Jhongguó}} Masalah Lua ing package.lua larik 80: module 'Modul:No globals' not found. |
|w= |
Wade–Giles[4] | {{Lang-zh|w=Chung1kuo2}} Masalah Lua ing package.lua larik 80: module 'Modul:No globals' not found. |
|j= |
Jyutping | {{Lang-zh|j=Gwong2zau1}} Masalah Lua ing package.lua larik 80: module 'Modul:No globals' not found. |
|cy= |
Cantonese Yale | {{Lang-zh|cy=Gwóngjāu}} Masalah Lua ing package.lua larik 80: module 'Modul:No globals' not found. |
|sl= |
Sidney Lau[4] | {{Lang-zh|sl=Gwong2jau1}} Masalah Lua ing package.lua larik 80: module 'Modul:No globals' not found. |
|poj= |
Pe̍h-ōe-jī | {{Lang-zh|poj=Tâi-tiong-kōan}} Masalah Lua ing package.lua larik 80: module 'Modul:No globals' not found. |
|zhu= |
Zhuyin Fuhao | {{Lang-zh|zhu=ㄊㄠˊ ㄩㄢˊ ㄒㄧㄢˋ}} Masalah Lua ing package.lua larik 80: module 'Modul:No globals' not found. |
|l= |
literal meaning | {{Lang-zh|l=Middle Kingdom}} Masalah Lua ing package.lua larik 80: module 'Modul:No globals' not found. |
|labels= |
Display language labels | See below |
|links= |
Display language links | See below |
|first= |
Override default ordering | See below |
|scase= |
Use sentence case | See below |
|out= |
Choose a parameter to display outside of brackets | See below |
- ↑ a b If
|s=
and|t=
are both given and are the same – if the simplified and traditional characters are identical – then they only appear once, in simplified Chinese typeface. E.g.{{Lang-zh|s=北京|t=北京}}
gives Masalah Lua ing package.lua larik 80: module 'Modul:No globals' not found. - ↑ If only one unnamed parameter is given, it will be treated as if it were passed to
|c=
- ↑ 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".
- ↑ a b Wade-Giles and SidneyLau romanizations use superscripted numbers for tones. The template automatically converts unsuperscripted tone numbers to superscripted ones.
Label options
[besut sumber]Add |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}}
- Masalah Lua ing package.lua larik 80: module 'Modul:No globals' not found.
Add |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}}
- Masalah Lua ing package.lua larik 80: module 'Modul:No globals' not found.
Add |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}}
- Masalah Lua ing package.lua larik 80: module 'Modul:No globals' not found.
Ordering
[besut sumber]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 using |first=
. It accepts a comma delimited list of values, though currently only two are supported (more can be added if needed)
|first=t
puts traditional Chinese before simplified Chinese, for example for Taiwan and Hong Kong topics|first=j
puts the Cantonese Romanizations, Jyutping and Yale, before pinyin Romanizations, for Hong Kong topics|first=poj
puts Hokkien POJ before pinyin romanizations, for Hokkien topics- They can be combined: either
|first=j,t
or|first=t,j
can be used
Examples:
{{Lang-zh| t=臺北| s=台北| hp=Táiběi}}
- Masalah Lua ing package.lua larik 80: module 'Modul:No globals' not found.
{{Lang-zh| t=臺北| s=台北| hp=Táiběi|first=t}}
- Masalah Lua ing package.lua larik 80: module 'Modul:No globals' not found.
{{Lang-zh| t=九龍| s=九龙| p=Jiǔlóng|j=gau2lung4}}
- Masalah Lua ing package.lua larik 80: module 'Modul:No globals' not found.
{{Lang-zh| t=九龍| s=九龙| p=Jiǔlóng|j=gau2lung4|first=t, j}}
- Masalah Lua ing package.lua larik 80: module 'Modul:No globals' not found.
It is also possible to override the default ordering for an article, so traditional Chinese appears before simplified Chinese, i.e. so all uses of the template default to |first=t
.
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
[besut sumber]|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 |s=
and |t=
are specified, and |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}}
- Masalah Lua ing package.lua larik 80: module 'Modul:No globals' not found.
{{Lang-zh| t=馬來西亞| s=马来西亚| hp=Mǎláixīyà| tr=Malaysia| labels=no| out=c}}
- Masalah Lua ing package.lua larik 80: module 'Modul:No globals' not found.
{{Lang-zh| t=可口可樂| s=可口可乐| p=Kěkǒu Kělè| tr=[[Coca-Cola]]| labels=no| out=p}}
- Masalah Lua ing package.lua larik 80: module 'Modul:No globals' not found.
TemplateData
[besut sumber]TemplateData documentation used by VisualEditor and other tools | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
TemplateData for Lang-zh A template to facilitate consistent layout, proper formatting, categorisation and language labelling of Chinese text and its romanizations
|
Tracking categories
[besut sumber]- Category:Articles containing Chinese-language text (0)
- Category:Articles containing simplified Chinese-language text (0)
- Category:Articles containing traditional Chinese-language text (0)
- Category:Pages using template Zh with sup tags (0)
See also
[besut sumber]{{CJKV}}
, a similar template, but with Japanese/Korean/Vietnamese functionality{{Lang}}
, a general purpose template used for single items:{{Lang|zh|中国}}
produces similar output to{{Lang-zh|c=中国|labels=no}}
{{Infobox Chinese}}
, an infobox that supports traditional and simplified Chinese as well as other common romanizations{{Old Chinese}}
, for reconstructed Old Chinese phonology{{Rarely-used Chinese characters}}
, to describe characters that may have trouble rendering properly
Aliases
[besut sumber]{{zhi}}
→{{lang-zh|labels=no}}
{{zht}}
→{{lang-zh|labels=no|out=tr}}
{{zhp}}
→{{lang-zh|labels=no|out=p}}
Dhokumèntasi ing ndhuwur katranklusi saka Cithakan:Lang-zh/doc. (besut | sujarah) Pambesut bisa njajal-jajal ing kaca bak wedhi (gawé | turunan) lan testcases (gawé) cithakan iki. Mangga tambahana kategori nyang anak kaca /doc. Anak kaca cithakan iki. |