Template:T/doc: Difference between revisions
(Created page with "{{Documentation subpage}} A template used to translate links from English to the current articles language (subpage language code). ==Usage== ===Default translation=== If the...") |
m (Automated Formatting) |
||
(7 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{Documentation subpage}} | {{Documentation subpage}} | ||
The {{tlx|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 <code>{{[[Template:Translation|Tr]]}}</code> template, which is a shorthand way of writing the {{tlx|Translation}} template. | |||
==Usage== | ==Usage== | ||
Line 25: | Line 27: | ||
[[Hammer/pl|Młotki]] | [[Hammer/pl|Młotki]] | ||
Which links to [[Hammer/pl]]. | Which still links to [[Hammer/pl]]. | ||
===Translation inside the T=== | |||
It is also possible to use the template {{[[Template:Translation|Translation]]}} or {{[[Template:Translation|Tr]]}} after the <code>|</code>, 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/pt-br#Bebida|Food]] page:''' | |||
<code><nowiki>{{</nowiki>T|Hot Cuppa|<nowiki>{{</nowiki>Tr|Cold Cuppa}}}}</code> | |||
'''Will result in:''' | |||
[[Hot Cuppa/pt-br|Bebida Gelada]] | |||
Which still links to [[Hot Cuppa/pt-br|Bebida Quente]]. | |||
===Remove link=== | |||
Alternatively, the link can be removed, showing only the translated text. | |||
'''For example on a Polish page:''' | |||
<code><nowiki>{{</nowiki>T|Hammer|no link}}</code> | |||
'''Will result in:''' | |||
Młotek |
Latest revision as of 14:27, 14 April 2024
This is a documentation subpage for Template:T.
It contains usage information and other content that is not part of the original template page. |
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:
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:
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:
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