Templat:Zh: Perbedaan antara revisi
kTidak ada ringkasan suntingan |
kTidak ada ringkasan suntingan |
||
Baris 4: | Baris 4: | ||
If no parameter is named, default to giving Chinese |
If no parameter is named, default to giving Chinese |
||
-->{{#if:{{{c|}}}{{{s|}}}{{{t|}}}{{{p|}}}{{{hp|}}}{{{tp|}}}{{{w|}}}{{{wg|}}}{{{j|}}}{{{y|}}}{{{cy|}}}{{{poj|}}}{{{b|}}}{{{zhu|}}}{{{l|}}}| |{{Language with name|zh| |
-->{{#if:{{{c|}}}{{{s|}}}{{{t|}}}{{{p|}}}{{{hp|}}}{{{tp|}}}{{{w|}}}{{{wg|}}}{{{j|}}}{{{y|}}}{{{cy|}}}{{{poj|}}}{{{b|}}}{{{zhu|}}}{{{l|}}}| |{{Language with name|zh|Chinese|{{{1}}}|links={{{links|}}}}}}}<!-- |
||
General Chinese |
General Chinese |
||
-->{{#if:{{{c|}}}|{{Language with name|zh| |
-->{{#if:{{{c|}}}|{{Language with name|zh|Chinese|{{{c|{{{1}}}}}}|links={{{links|}}}}}{{#if:{{{l|}}}{{{poj|}}}{{{cy|{{{y|}}}}}}{{{j|}}}{{{w|{{{wg|}}}}}}{{{tp|}}}{{{hp|{{{p|}}}}}}{{{t|}}}{{{s|}}}{{{b|{{{zhu|}}}}}}|{{;}} }}|{{#ifeq:{{{s}}}|{{{t}}}|{{Language with name|zh|Chinese|{{{s|{{{1}}}}}}|links={{{links|}}}}}{{#if:{{{l|}}}{{{poj|}}}{{{cy|{{{y|}}}}}}{{{j|}}}{{{w|{{{wg|}}}}}}{{{tp|}}}{{{hp|{{{p|}}}}}}{{{t|}}}{{{s|}}}{{{b|{{{zhu|}}}}}}|{{;}} }} |
||
}}<!-- |
}}<!-- |
||
Make traditional display first if specified; otherwise, do nothing |
Make traditional display first if specified; otherwise, do nothing |
||
-->{{#ifeq:{{{first|{{#ifexist:Template:zh/format/{{FULLPAGENAME}}|{{zh/format/{{FULLPAGENAME}}}}}}}}}|t|{{#if:{{{t|}}}|{{#ifeq:{{{links|}}}|no|{{#if:{{{s|}}}| |
-->{{#ifeq:{{{first|{{#ifexist:Template:zh/format/{{FULLPAGENAME}}|{{zh/format/{{FULLPAGENAME}}}}}}}}}|t|{{#if:{{{t|}}}|{{#ifeq:{{{links|}}}|no|{{#if:{{{s|}}}|traditional }}Chinese|[[Hanzi Tradisional|{{#if:{{{s|}}}|traditional }}Chinese]]}}: {{lang|zh-Hant|{{{t}}}}}{{#if:{{{l|}}}{{{poj|}}}{{{cy|{{{y|}}}}}}{{{j|}}}{{{w|{{{wg|}}}}}}{{{tp|}}}{{{hp|{{{p|}}}}}}{{{b|{{{zhu|}}}}}}{{{s|}}}|{{;}} }}}} |
||
}}}}<!-- |
}}}}<!-- |
||
Baris 21: | Baris 21: | ||
-->{{#ifeq:{{{s}}}|{{{t}}}| |<!-- If s and t are the same, do nothing. otherwise |
-->{{#ifeq:{{{s}}}|{{{t}}}| |<!-- If s and t are the same, do nothing. otherwise |
||
-->{{#if:{{{s|}}}|<!-- Do this if there's an s parameter: |
-->{{#if:{{{s|}}}|<!-- Do this if there's an s parameter: |
||
-->{{#ifeq:{{{links|}}}|no|<!-- Choose whether or not to link " |
-->{{#ifeq:{{{links|}}}|no|<!-- Choose whether or not to link "simplified Chinese" |
||
-->{{#if:{{{t|}}}| |
-->{{#if:{{{t|}}}|simplified }}Chinese|<!-- |
||
-->[[Hanzi Sederhana|{{#if:{{{t|}}}| |
-->[[Hanzi Sederhana|{{#if:{{{t|}}}|simplified }}Chinese]]}}: {{lang|zh-Hans|{{{s}}}<!-- |
||
-->}}<!-- |
-->}}<!-- |
||
-->{{#if:{{{t|}}}|<!-- If there are also traditional characters: |
-->{{#if:{{{t|}}}|<!-- If there are also traditional characters: |
||
Baris 42: | Baris 42: | ||
-->{{#ifeq:{{{s}}}|{{{t}}}| |<!-- If s and t are the same, do nothing. otherwise |
-->{{#ifeq:{{{s}}}|{{{t}}}| |<!-- If s and t are the same, do nothing. otherwise |
||
-->{{#ifeq:{{{first|{{#ifexist:Template:zh/format/{{FULLPAGENAME}}|{{zh/format/{{FULLPAGENAME}}}}}}}}}|t| |{{#if:{{{t|}}}|{{#ifeq:{{{links|}}}|no|{{#if:{{{s|}}}| |
-->{{#ifeq:{{{first|{{#ifexist:Template:zh/format/{{FULLPAGENAME}}|{{zh/format/{{FULLPAGENAME}}}}}}}}}|t| |{{#if:{{{t|}}}|{{#ifeq:{{{links|}}}|no|{{#if:{{{s|}}}|traditional }}Chinese|[[Hanzi Tradisional|{{#if:{{{s|}}}|traditional }}Chinese]]}}: {{lang|zh-Hant|{{{t}}}}}{{#if:{{{l|}}}{{{poj|}}}{{{cy|{{{y|}}}}}}{{{j|}}}{{{w|{{{wg|}}}}}}{{{tp|}}}{{{hp|{{{p|}}}}}}{{{b|{{{zhu|}}}}}}|{{;}} }} |
||
}}}}}}<!-- |
}}}}}}<!-- |
||
Baris 76: | Baris 76: | ||
}}<!-- |
}}<!-- |
||
Yale Kanton |
|||
-->{{#if:{{{cy|{{{y|}}}}}}|{{#ifeq:{{{links|}}}|no|Cantonese Yale|[[Alih aksara Yale|Yale |
-->{{#if:{{{cy|{{{y|}}}}}}|{{#ifeq:{{{links|}}}|no|Cantonese Yale|[[Alih aksara Yale|Cantonese Yale]]}}: {{{cy|{{{y|}}}}}}{{#if:{{{l|}}}{{{poj|}}}{{{b|{{{zhu|}}}}}}|{{;}} }} |
||
}}<!-- |
}}<!-- |
||
Revisi per 12 April 2014 09.36
Templat ini menggunakan fitur sintaks templat yang rumit.
Anda seharusnya sudah memahami penyetelan dan fungsi parser sebelum menyunting templat ini. Jika suntingan Anda menyebabkan permasalahan yang tidak diinginkan, mohon untuk membaliknya secepatnya, karena templat ini mungkin muncul pada sejumlah besar halaman. Ingat bahwa semua percobaan dan perbaikan harus diuji terlebih dahulu di Bak pasir atau di ruang pengguna Anda sebelum mengubah sesuatu di sini. |
Chinese: {{{1}}}
{{Inuse|Beeyan}}
About
There used to be a large number of separate Chinese/romanization support templates to use, depending on what you wanted to display; for example, {{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, etc. This template was created to combine all those into one template with all the 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, and Pe̍h-ōe-jī romanizations.
Usage
- Parameters
To use the template, start with {{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 |
---|---|---|
|c= |
Chinese | {{zh|c=中国}} Chinese: 中国 |
|s= |
simplified Chinese[1] | {{zh|s=中国}} Chinese: 中国 |
|t= |
traditional Chinese[1] | {{zh|t=中國}} Chinese: 中國 |
|p= or |hp= |
Pinyin[2] | {{zh|p=zhōngguó}} pinyin: zhōngguó |
|tp= |
Tongyong Pinyin | {{zh|tp=Jhongguó}} Tongyong Pinyin: Jhongguó |
|w= |
Wade–Giles | {{zh|w=Chung¹kuo²}} Wade–Giles: Chung¹kuo² |
|j= |
Jyutping | {{zh|j=Gwong²zau¹}} Jyutping: Gwong²zau¹ |
|cy= |
Cantonese Yale | {{zh|cy=Gwóngjàu}} Cantonese Yale: Gwóngjàu |
|poj= |
Pe̍h-ōe-jī | {{zh|poj=Tâi-tiong-kōan}} Pe̍h-ōe-jī: Tâi-tiong-kōan |
|zhu= |
Zhuyin Fuhao | {{zh|zhu=ㄊㄠˊ ㄩㄢˊ ㄒㄧㄢˋ}} Zhuyin Fuhao: ㄊㄠˊ ㄩㄢˊ ㄒㄧㄢˋ |
|l= |
literal meaning | {{zh|l=Middle Kingdom}} literally "Middle Kingdom" |
- ^ a b If
|s=
and|t=
are both given and are the same (i.e., if the simplified and traditional characters are the same), instead of showing both the template will just show "Chinese:{{{s}}}
" - ^ 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".
- 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).
For some articles, however, it is more appropriate to display traditional characters before simplified, and Tongyong before Hanyu—this is the case with articles relating to Taiwan, for instance. To do this, add |first=t
anywhere in the template, and the traditional and Tongyong will be shown first. For example:
{{zh|t=中國|s=中国|hp=Zhōngguó|tp=Jhongguó}}
- simplified Chinese: 中国; traditional Chinese: 中國; Hanyu Pinyin: Zhōngguó; Tongyong Pinyin: Jhongguó
{{zh|t=中國|s=中国|hp=Zhōngguó|tp=Jhongguó|first=t}}
- traditional Chinese: 中國; simplified Chinese: 中国; Tongyong Pinyin: Jhongguó; Hanyu Pinyin: Zhōngguó
In the future the template may be updated to allow |first=j
, putting Jyutping before pinyin (for use in Cantonese-related articles). This functionality has not been written yet, and would not be without first having a project-wide discussion to see if it's appropriate to choose Jyutping (or any other romanization) as the "default" for Cantonese.
- Other functionality
Adding |links=no
anywhere in the template will suppress links. This is for preventing overlinking in an article or section where the template is used repeatedly.
{{zh|t=中國|s=中国|hp=Zhōngguó|tp=Jhongguó|links=no}}
- simplified Chinese: 中国; traditional Chinese: 中國; Hanyu Pinyin: Zhōngguó; Tongyong Pinyin: Jhongguó
Default ordering
To put traditional characters before simplified, one option is to add |first=t
to every instance of the template within an article. In an article that calls the template many times, though, this may be tedious, and usually an article should have consistent ordering throughout anyway (for example, articles about Hong Kong topics should almost always have traditional characters first). A default ordering can be specified for an entire article by creating a subpage of this template with the name of that article (for instance, Templat:zh/format/Taiwan sets the default ordering for the article Taiwan); the subpage should include a single character, t
to set traditional-first ordering or s
to set simplified-first ordering. You can do this by entering the name of the article you want to set in the box below (replacing YOUR ARTICLE TITLE
) and following the instructions.
After doing this, be sure to add either {{zh/notice|t}}
or {{zh/notice|s}}
to the article's talk page, to inform other editors that you have set a default and to let them know where the default setting is located.