Template:Tr

From Thorium Mod Wiki
Jump to navigation Jump to search
Template-info.svg Documentation The documentation below is transcluded from Template:Tr/doc. (edit | history)

This template translates a given game term from English into another language, based on the translation databases. It is one of the most powerful and crucial templates for the translation projects.

Usage

{{ tr | lang = <target language> (optional) | <term to translate> | link = y (optional) }}

First unnamed parameter

The term that is to be translated. It needs to be registered in the translation database for the target language, otherwise the template will simply display the term, untranslated.

lang

Language code of the language to translate the term into. Defaults to {{lang}}, so it can almost always be omitted.

link

Display the link to the page of the term in the target language, instead of the translated term itself. While this will usually have no effect on off-wiki language wikis (zh) since these have page names in their languages, its effect is important for the other language wikis, whose page names are in English.

Examples

The $lang parameter is used here for demonstrative purposes. In the vast majority of cases, it can be omitted as it will automatically detect the correct target language via {{lang}}.

Code Result
{{tr|lang=zh|Bard items}} 吟游诗人物品
{{tr|lang=zh|Bard Wings}} Bard Wings
{{tr|lang=zh|Bard items|link=y}} Bard items/zh

Based on performance considerations, input text is case-sensitive.

Code Result
{{tr|lang=zh|Bard items}} 吟游诗人物品
{{tr|lang=zh|Bard Items}} Bard Items
{{tr|lang=zh| Bard items }} 吟游诗人物品
{{tr|lang=zh|Bard    items}} Bard items

Translation databases

The following templates hold all translations that {{tr}} bases its output on.

Flag cn.svg Chinese: Template:Tr/db-zh

See also

  • {{tr2e}} for the reverse functionality, translating a term from a local language back to English.