Template:LC zh

From mediawiki.org
This page is a translated version of the page Template:LC zh and the translation is 97% complete.
Template documentation

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í

  • Typy obsahu
    • T: Název stránky
      • Pouze pro hlavní jmenný prostor: {{LC zh|T|zh-hans=<název stránky zh-Hans>|zh-hant=<název stránky zh-Hant>}}
      • {{LC zh|T|nsp={{{nsp|}}}|<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|T|nsp={{{nsp|}}}|<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>}}
      • Příklad: {{LC zh|T|nsp={{{nsp|}}}|Project|zh-hans=关于|zh-hant=關於}}
    • C: Obsah
      • {{LC zh|C|zh-hans=<obsah zh-Hans>|zh-hant=<obsah zh-Hant>}}
      • {{LC zh|C|zh-hans=<obsah zh-Hans>|zh-hant=<obsah zh-Hant (zh-Hant-TW)>|zh-hk=<obsah zh-Hant-HK>}}
      • Příklad: {{LC zh|C|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

No description.

Template parameters[Edit template data]

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Language variantvariant

Specify the language variant to output

Stringoptional
Content typetype 1

The content type to convert.

  • "N": namespace name
  • "T": page title
  • "H": headings
  • "C": content

    Suggested values
    N T H C
    Example
    T
    Auto value
    C
Stringrequired
Hide namespace namehide_ns 2 nsp

Only for title output mode (T).

Used for pass nsp parameter from "Template:Localized link".

Only required for non-main-namespace page title texts.

Suggested values
{{{nsp|}}}
Example
{{{nsp|}}}
Auto value
{{{nsp|}}}
Numbersuggested
English canonical namespace namens 3 namespace

Only for namespace name (N) and title (T) output modes. The English namespace name of the full page title text.

Suggested values
User User talk Project Template Help Category Manual Extension API Skin
Example
Help
Stringsuggested
2nd English canonical namespace namens_2

Expecially for Help namespace cases like "Help:Extension:".

Only for namespace name (N) and title (T) output modes.

The English namespace name of the full page title text.

Example
Extension
Stringoptional
zh-hanszh-hans

Mandarin (Simplified Han script) content

Stringsuggested
zh-hantzh-hant

Mandarin (Traditional Han script, Taiwan) content

Stringsuggested
zh-hkzh-hk

Mandarin (Traditional Han script, Hong Kong) content

Stringoptional

Test cases

All tests passed.

test_main:

Text Expected Actual
Yes {{#invoke:LC zh|main}}
Yes {{#invoke:LC zh|main|type=N}}
Yes {{#invoke:LC zh|main|type=N|ns=User}} User User
Yes {{#invoke:LC zh|main|type=N|ns=Help}} Help Help
Yes {{#invoke:LC zh|main|type=T}}
Yes {{#invoke:LC zh|main|type=T|ns=User}} User: User:
Yes {{#invoke:LC zh|main|type=T|ns=Help}} Help: Help:
Yes {{#invoke:LC zh|main|type=T|ns=User|zh=Example}} User:Example User:Example
Yes {{#invoke:LC zh|main|type=T|ns=Help|zh=Example|zh-hans=示例|zh-hant=範例}} Help:Example Help:Example
Yes {{#invoke:LC zh|main|type=T|hide_ns=1|ns=Help}}
Yes {{#invoke:LC zh|main|type=T|hide_ns=1|ns=Help|zh=Example|zh-hans=示例|zh-hant=範例}} Example Example
Yes {{#invoke:LC zh|main|type=H}}
Yes {{#invoke:LC zh|main|type=C}}
Yes {{#invoke:LC zh|main|type=C|zh=Example|zh-hans=示例|zh-hant=範例}} Example Example

test_template:

Text Expected Actual
Yes {{LC zh}}
Yes {{LC zh|type=N}}
Yes {{LC zh|type=N|ns=User}} User User
Yes {{LC zh|type=N|ns=Help}} Help Help
Yes {{LC zh|type=T}}
Yes {{LC zh|type=T|ns=User}} User: User:
Yes {{LC zh|type=T|ns=Help}} Help: Help:
Yes {{LC zh|type=T|ns=User|zh=Example}} User:Example User:Example
Yes {{LC zh|type=T|ns=Help|zh=Example|zh-hans=示例|zh-hant=範例}} Help:Example Help:Example
Yes {{LC zh|type=T|hide_ns=1|ns=Help}}
Yes {{LC zh|type=T|hide_ns=1|ns=Help|zh=Example|zh-hans=示例|zh-hant=範例}} Example Example
Yes {{LC zh|type=H}}
Yes {{LC zh|type=C}}
Yes {{LC zh|type=C|zh=Example|zh-hans=示例|zh-hant=範例}} Example Example