Jump to content

Template:LC zh

From mediawiki.org
This page is a translated version of the page Template:LC zh and the translation is 100% complete.
Dokumentace šablony

Popis

Tato šablona zpracovává jazykovou konverzi ("LC") pro názvy a obsah stránek v mandarínštině ("zh"), zejména pro názvy stránek s názvy jmenného prostoru nebo bez nich (parametr "nsp"), obsah v nástroji Language Converter a bez převodníku jazyků stránky.

Použití

Použití se u jednotlivých typů obsahu liší.

Nefragmentujte obsah, pokud se nejedná o specifickou syntaxi Wikitextu (nadpisy sekcí, seznamy).

Green tickY {{LC zh|lang = {{{lang|}}}|type = C|zh-hans = 按需求配置。|zh-hant = 按需求設定組態。}}

N 按需求{{LC zh|lang = {{{lang|}}}|type = C|zh-hans = 配置|zh-hant = 設定組態}}

Green tickY {{LC zh|lang = {{{lang|}}}|type = C|zh-hans = '''按需求配置。'''|zh-hant = '''按需求設定組態。'''}}

N '''{{LC zh|lang = {{{lang|}}}|type = C|zh-hans = 按需求配置。|zh-hant = 按需求設定組態。}}'''

Green tickY == {{LC zh|lang = {{{lang|}}}|type = C|zh-hans = 按需求配置。|zh-hant = 按需求設定組態。}} ==

N {{LC zh|lang = {{{lang|}}}|type = C|zh-hans = == 按需求配置。 ==|zh-hant = == 按需求設定組態。 ==}}

N == 按需求{{LC zh|lang = {{{lang|}}}|type = C|zh-hans = 配置|zh-hant = 設定組態}}。 ==

Green tickY * {{LC zh|lang = {{{lang|}}}|type = C|zh-hans = 按需求配置。|zh-hant = 按需求設定組態。}}

N {{LC zh|lang = {{{lang|}}}|type = C|zh-hans = * 按需求配置。|zh-hant = * 按需求設定組態。}}

N * 按需求{{LC zh|lang = {{{lang|}}}|type = C|zh-hans = 配置|zh-hant = 設定組態}}

N - Názvy jmenných prostorů

Tento typ nepoužívejte v názvu stránky.

Pouze název jmenného prostoru:

  • {{LC zh|lang = {{{lang|}}}|hide_ns = {{{nsp|}}}|type = N|ns = <název jmenného prostoru v en>}}

Obsahuje pseudo-jmenný prostor:

  • {{LC zh|lang = {{{lang|}}}|hide_ns = {{{nsp|}}}|type = N|ns = <název jmenného prostoru v en>|ns_2 = <název pseudo-jmenného prostoru v en>}}

Příklad:

  • {{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 - Zobrazený název stránky

Pro názvy stránek v hlavním jmenném prostoru:

  • {{LC zh|lang = {{{lang|}}}|hide_ns = {{{nsp|}}}|type = T|ns = |zh-hans = <název stránky zh-Hans>|zh-hant = <název stránky zh-Hant>}}

Pro názvy stránek obsahující název jmenného prostoru:

  • {{LC zh|lang = {{{lang|}}}|hide_ns = {{{nsp|}}}|type = T|ns = <název jmenného prostoru v en>|zh-hans = <název stránky zh-Hans>|zh-hant = <název stránky zh-Hant>}}
  • {{LC zh|lang = {{{lang|}}}|hide_ns = {{{nsp|}}}|type = T|ns = <název jmenného prostoru v en>|zh-hans = <název stránky zh-Hans>|zh-hant = <název stránky zh-Hant (zh-Hant-TW)>|zh-hk = <název stránky zh-Hant-HK>}}

Pro názvy stránek obsahující pseudo-jmenný prostor:

  • {{LC zh|lang = {{{lang|}}}|hide_ns = {{{nsp|}}}|type = T|ns = <název jmenného prostoru v en>|ns_2 = <název pseudo-jmenného prostoru v en>|zh-hans = <název stránky zh-Hans>|zh-hant = <název stránky zh-Hant>}}
  • {{LC zh|lang = {{{lang|}}}|hide_ns = {{{nsp|}}}|type = T|ns = <název jmenného prostoru v en>|ns_2 = <název pseudo-jmenného prostoru v en>|zh-hans = <název stránky zh-Hans>|zh-hant = <název stránky zh-Hant (zh-Hant-TW)>|zh-hk = <název stránky zh-Hant-HK>}}

Příklad:

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

H - Nadpisy

Nadpisy mohou automaticky generovat více kotev pro různé jazykové varianty.

  • == {{LC zh|lang = {{{lang|}}}|type = H|zh-hans = <záhlaví sekce zh-Hans>|zh-hant = <záhlaví sekce zh-Hant>}} ==
  • == {{LC zh|lang = {{{lang|}}}|type = H|zh-hans = <záhlaví sekce zh-Hans>|zh-hant = <záhlaví sekce zh-Hant (zh-Hant-TW)>|zh-hk = <záhlaví sekce zh-Hant-HK>}} ==

Příklad:

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

C - Obsah

‎<pre> a ‎<syntaxhighlight> by měly používat tento typ se syntaxí {{#tag:, aby se zabránilo převodu nefunkčního jazyka.
  • {{LC zh|lang = {{{lang|}}}|type = C|zh-hans = <obsah zh-Hans>|zh-hant = <obsah zh-Hant>}}
  • {{LC zh|lang = {{{lang|}}}|C|zh-hans = <obsah zh-Hans>|zh-hant = <obsah zh-Hant (zh-Hant-TW)>|zh-hk = <obsah zh-Hant-HK>}}

Příklad:

  • {{LC zh|lang = {{{lang|}}}|type = C|zh-hans = 关于|zh-hant = 關於}} → 关于
  • {{#tag:syntaxhighlight|<code>{{LC zh|lang = {{{lang|}}}|type = C|zh-hans = 关于|zh-hant = 關於}}</code>|lang=wikitext|inline=}}<code>关于</code>

U - Nekonvertibilní obsah

Tento typ používejte pouze v nekonvertibilním obsahu, např. globální oznámení, bloky zvýrazňování syntaxe, systémové zprávy, šablony uživatelských stránek.
Tento typ nepoužívejte pro ‎<pre> a ‎<syntaxhighlight>.
  • {{LC zh|lang = {{{lang|}}}|type = U|zh-hans = <obsah zh-Hans>|zh-hant = <obsah zh-Hant>}}
  • {{LC zh|lang = {{{lang|}}}|U|zh-hans = <obsah zh-Hans>|zh-hant = <obsah zh-Hant (zh-Hant-TW)>|zh-hk = <obsah zh-Hant-HK>}}

Příklad:

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

Integrace s jinými šablonami a moduly

Poznámky

Pokud je šablonou uživatelská šablona stránky, globální oznámení atd., kterou nelze převést pomocí Language Converter, měli byste zvážit použití Template:Conversion-zh místo této šablony.

Template data

[zobrazit · diskuse · upravit]

Tato sekce obsahuje strukturovaný popis parametrů šablony využívající rozšíření TemplateData, který umožňuje snadnější používání této šablony v prostředí VisualEditoru.

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 - Do not use this type in page display title, "T" - Page display title, "H" - Section heading, "C" - Text content, "U" - Unconvertible content - Only use this type in unconvertible content, e.g., global announcements, syntax highlight blocks, system messages, user page templates. 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
Edituj překlady parametrů

Testovací případy

All tests passed.

test_main:

Text Expected Actual
Yes {{#invoke:LC zh|main}} An error Caught expected error: Lua error: Unknown content type code "nil".
Yes {{#invoke:LC zh|main|lang = {{{lang|}}}}} An error Caught expected error: Lua error: Unknown content type code "nil".
Yes {{#invoke:LC zh|main|lang = {{{lang|}}}|type = N}} An error Caught expected error: Lua error: Missing parameter "ns".
Yes {{#invoke:LC zh|main|lang = {{{lang|}}}|type = N|ns = }}
Yes {{#invoke:LC zh|main|lang = {{{lang|}}}|type = N|ns = User}} User User
Yes {{#invoke:LC zh|main|lang = {{{lang|}}}|type = N|ns = Help}} Help Help
Yes {{#invoke:LC zh|main|lang = {{{lang|}}}|type = T}} An error Caught expected error: Lua error: Require at least one of the parameter: "zh-hans", "zh-hant", "zh-hk".
Yes {{#invoke:LC zh|main|lang = {{{lang|}}}|type = T|ns = User}} An error Caught expected error: Lua error in Module:LC_zh at line 591: Require at least one of the parameter: "zh-hans", "zh-hant", "zh-hk".
Yes {{#invoke:LC zh|main|lang = {{{lang|}}}|type = T|ns = User|zh-hans = Example|zh-hant = Example}} User:Example User:Example
Yes {{#invoke:LC zh|main|lang = {{{lang|}}}|type = T|ns = Help|zh-hans = 示例|zh-hant = 範例}} Help:示例 Help:示例
Yes {{#invoke:LC zh|main|lang = {{{lang|}}}|type = T|ns = Help|zh-hant = 範例}} Help:範例 Help:範例
Yes {{#invoke:LC zh|main|lang = {{{lang|}}}|type = T|hide_ns = 1|ns = Help}} An error Caught expected error: Lua error: Require at least one of the parameter: "zh-hans", "zh-hant", "zh-hk".
Yes {{#invoke:LC zh|main|lang = {{{lang|}}}|type = T|hide_ns = 1|ns = Help|zh-hans = 示例|zh-hant = 範例}} 示例 示例
Yes {{#invoke:LC zh|main|lang = {{{lang|}}}|type = H}} An error Caught expected error: Lua error in Module:LC_zh at line 620: Require at least one of the parameter: "zh-hans", "zh-hant", "zh-hk".
Yes {{#invoke:LC zh|main|lang = {{{lang|}}}|type = H|zh-hans = 用户|zh-hant = 使用者|zh-hk = 用戶}} 用户 用户
Yes {{#invoke:LC zh|main|lang = {{{lang|}}}|type = C}} An error Caught expected error: Lua error: Require at least one of the parameter: "zh-hans", "zh-hant", "zh-hk".
Yes {{#invoke:LC zh|main|lang = {{{lang|}}}|type=C|zh-hans=示例|zh-hant=範例}} 示例 示例

test_template:

Text Expected Actual
Yes {{LC zh}} An error Caught expected error: Lua error: Unknown content type code "nil".
Yes {{LC zh|lang = {{{lang|}}}}} An error Caught expected error: Lua error: Unknown content type code "nil".
Yes {{LC zh|lang = {{{lang|}}}|type = N}} An error Caught expected error: Lua error: Missing parameter "ns".
Yes {{LC zh|lang = {{{lang|}}}|type = N|ns = }}
Yes {{LC zh|lang = {{{lang|}}}|type = N|ns = User}} User User
Yes {{LC zh|lang = {{{lang|}}}|type = N|ns = Help}} Help Help
Yes {{LC zh|lang = {{{lang|}}}|type = T}} An error Caught expected error: Lua error: Require at least one of the parameter: "zh-hans", "zh-hant", "zh-hk".
Yes {{LC zh|lang = {{{lang|}}}|type = T|ns = User}} An error Caught expected error: Lua error in Module:LC_zh at line 591: Require at least one of the parameter: "zh-hans", "zh-hant", "zh-hk".
Yes {{LC zh|lang = {{{lang|}}}|type = T|ns = User|zh-hans = Example|zh-hant = Example}} User:Example User:Example
Yes {{LC zh|lang = {{{lang|}}}|type = T|ns = Help|zh-hans = 示例|zh-hant = 範例}} Help:示例 Help:示例
Yes {{LC zh|lang = {{{lang|}}}|type = T|ns = Help|zh-hant = 範例}} Help:範例 Help:範例
Yes {{LC zh|lang = {{{lang|}}}|type = T|hide_ns = 1|ns = Help}} An error Caught expected error: Lua error: Require at least one of the parameter: "zh-hans", "zh-hant", "zh-hk".
Yes {{LC zh|lang = {{{lang|}}}|type = T|hide_ns = 1|ns = Help|zh-hans = 示例|zh-hant = 範例}} 示例 示例
Yes {{LC zh|lang = {{{lang|}}}|type = H}} An error Caught expected error: Lua error in Module:LC_zh at line 620: Require at least one of the parameter: "zh-hans", "zh-hant", "zh-hk".
Yes {{LC zh|lang = {{{lang|}}}|type = H|zh-hans = 用户|zh-hant = 使用者|zh-hk = 用戶}} 用户 用户
Yes {{LC zh|lang = {{{lang|}}}|type = C}} An error Caught expected error: Lua error: Require at least one of the parameter: "zh-hans", "zh-hant", "zh-hk".
Yes {{LC zh|lang = {{{lang|}}}|type=C|zh-hans=示例|zh-hant=範例}} 示例 示例

test_template_localized_link:

Text Expected Actual
Yes {{Localized link}} [[Special:MyLanguage/{{{1}}}|{{{1}}}]]<span style="display:none">[[:{{{1}}}| ]]</span> [[Special:MyLanguage/{{{1}}}|{{{1}}}]]<span style="display:none">[[:{{{1}}}| ]]</span>

test_template_localized_link_sandbox:

Text Expected Actual
Yes {{Localized link/sandbox}} [[Special:MyLanguage/{{{1}}}|{{{1}}}]]<span style="display:none">[[:{{{1}}}| ]]</span> [[Special:MyLanguage/{{{1}}}|{{{1}}}]]<span style="display:none">[[:{{{1}}}| ]]</span>

Sledovací kategorie