Template:T: Difference between revisions

From PZwiki
(added optional "no link" to turn off link)
m (Automated Formatting)
 
(13 intermediate revisions by 6 users not shown)
Line 1: Line 1:
<includeonly>{{#ifeq:{{{2|}}}|no link|{{{1}}}|[[{{{1}}}{{#switch:{{#titleparts: {{FULLPAGENAME}} | | -1 }}
<includeonly>{{#ifeq:{{{2|}}}|no link|{{Translation|{{{1}}}}}|[[{{{1}}}{{#switch:{{#titleparts: {{FULLPAGENAME}} | | -1 }}
| cs = /cs
| de = /de
| de = /de
| es = /es
| es = /es
| fr = /fr
| fr = /fr
| hu = /hu
| it = /it
| it = /it
| ja = /ja
| ja = /ja
Line 10: Line 12:
| pl = /pl
| pl = /pl
| pt = /pt
| pt = /pt
| pt-br = /pt-br
| ru = /ru
| ru = /ru
| zh = /zh
| th = /th
| #default =  
| tr = /tr
}}|{{#if:{{{2|}}}|{{{2}}}|{{Translation|{{{1}}}}}}}]]}}</includeonly><noinclude>{{documentation}}[[Category:Language templates]]</noinclude>
| uk = /uk
| zh-hans = /zh-hans
| zh-hant = /zh-hant
| #default =
}}|{{#if:{{{2|}}}|{{{2}}}|{{Translation|{{{1}}}}}}}]]}}</includeonly><noinclude>{{Deprecated|Ll}}{{documentation}}[[Category:Language templates]]</noinclude>

Latest revision as of 14:27, 14 April 2024

Imbox content.png
This template is deprecated.
This template will eventually be removed. Please use Template:Localized link instead.
[view] [edit] [history] [purge] Template documentation
The {{T}} template is used to translate links from English to the current article's language (subpage language code). The names are generated based on the data in the Template:Translation database.

This is not to be confused with the {{Tr}} template, which is a shorthand way of writing the {{Translation}} template.

Usage

Default translation

If the current article subpage is /pl (Polish):

{{T|Hammer}}

Will result in:

Młotek

Which links to Młotek.

Custom translation

Similar to a normal link, a pipe | can be used after the English word, then proceeded by the desired word/phrase.

For example on a Polish page:

{{T|Hammer|Młotki}}

Will result in:

Młotki

Which still links to Młotek.

Translation inside the T

It is also possible to use the template {{Translation}} or {{Tr}} after the |, while still inside the T. This will result in the desired word/phrase being translated to the other language if it is registered.

In the next example, the items that are in Brazilian Portuguese translate to:

  • Bebida Quente == Hot Cuppa
  • Bebida Gelada == Cold Cuppa

For example on the Brazilian Portuguese Food page:

{{T|Hot Cuppa|{{Tr|Cold Cuppa}}}}

Will result in:

Bebida Gelada

Which still links to Bebida Quente.

Remove link

Alternatively, the link can be removed, showing only the translated text.

For example on a Polish page:

{{T|Hammer|no link}}

Will result in:

Młotek
Documentation transcluded from Template:T/doc.
Editors can experiment in this template's sandbox (create)