Шаблон:Displaytext/doc

Материал из Calamity Mod Wiki
Перейти к навигации Перейти к поиску

Get display text. Used in templates with link and custom display text. For English, it will do intuitive pluralism process for plural suffixes (s/es/ies).

Usage

{{displaytext|arg1|arg2|lang=<lang>}} The result text will be auto-translated by {{tr}} (also see below).

Unnamed Parameter 1

Base text (is usually the link)

Unnamed Parameter 2 (optional)

Custom display text, or plural suffix (s/es/ies)

lang (optional)

Language code for plural process. Default is {{lang}}.

Examples

Code Result Note
{{displaytext|Block}} Блок Regular
{{displaytext|Block|s}} Блок
{{displaytext|Boss|es}} Босс
{{displaytext|Butterfly|ies}} Butterfly
{{displaytext| Boss | es }} Boss Spaces will be ignored.
{{displaytext|Boss|s}} Босс Smart process for "s"
{{displaytext|Cash|s}} Cash
{{displaytext|Watch|s}} Watch
{{displaytext|Box|s}} Box
{{displaytext|Butterfly|s}} Butterfly
{{displaytext|Mouse|s}} Mouse
{{displaytext|Leaf|s}} Leaf
{{displaytext|Staff|s}} Посох
{{displaytext|Knife|s}} Нож
{{displaytext|Campfire|s}} Костёр
{{displaytext|Gold Table|Golden}} Golden Custom display text
{{displaytext|Draedon's Forge|s|lang=ko}} i18n support.

L10n note

This template is designed to work with auto translation, therefore, for non-English languages, it should be able to recognize English plural suffixes, and not treat them as custom text, even if they are not plural suffixes in the target language. Auto translation can be turned off in the code of the template.

For example, for English, {{displaytext|Moon Lord|s}} will output Moon Lords, while for Chinese (zh), {{displaytext|Moon Lord|s}} will/should output 月亮领主 (auto-translated) or Moon Lord (if it cannot be auto-translated) instead of s only (there is no plural form grammar in Chinese, but {{displaytext}} will recognize "s" as plural suffix and ignore it instead of displaying it as custom text).