Template:UnitLink: Difference between revisions
From Heroes of Might and Magic: Olden Era Official Wiki
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
<includeonly>{{#if:{{{3|}}}|[[{{#invoke:Unit|get|{{{1|}}}|name|{{{2|}}}}}]]|[[{{{4|{{{1|}}}}}}{{LangSuffix|{{{2|}}}}}|{{#invoke:Unit|get|{{{1|}}}|name|{{{2|}}}}}]]}}</includeonly><noinclude> | <includeonly>{{#if:{{{3|}}}|[[{{#invoke:Unit|get|{{{1|}}}|name|{{{2|}}}}}]]|[[{{{4|{{{1|}}}}}}{{LangSuffix|{{{2|}}}}}|{{#invoke:Unit|get|{{{1|}}}|name|{{{2|}}}}}]]}}</includeonly><noinclude> | ||
This template uses [[Module:Unit]] to create an automatically translated link to a unit. | |||
<nowiki>{</nowiki>{'''UnitLink'''|''Unit name''|''Language code''|''Link type''|''Custom link''}} | <nowiki>{</nowiki>{'''UnitLink'''|''Unit name''|''Language code''|''Link type''|''Custom link''}} | ||
*<code>''Unit name''</code> — in-game unit name in English. | *<code>''Unit name''</code> — in-game unit name in English. | ||
*<code>''Link type''</code> — ignore to get link in a form of <code><nowiki>[[link/langcode|text]]</nowiki></code>; insert ''any'' text to get link in a form of <code><nowiki>[[link]]</nowiki></code>. | *<code>''Link type''</code> — ignore to get link in a form of <code><nowiki>[[link/langcode|text]]</nowiki></code>; insert ''any'' text to get link in a form of <code><nowiki>[[link]]</nowiki></code>. | ||
*<code>''Custom link''</code> — text to replace a link in the default link type to get <code><nowiki>[[Custom link/langcode|text]]</nowiki></code>. Useful if the article title differs from the unit name in the game (e.g. [[Stinger (unit)]]. | *<code>''Custom link''</code> — text to replace a link in the default link type to get <code><nowiki>[[Custom link/langcode|text]]</nowiki></code>. Useful if the article title differs from the unit name in the game (e.g. [[Stinger (unit)]]). | ||
{{LanguageCodesNote}} | {{LanguageCodesNote}} | ||
[[Category:Utility_templates]] | [[Category:Utility_templates]] | ||
Latest revision as of 22:06, 28 April 2026
This template uses Module:Unit to create an automatically translated link to a unit.
{{UnitLink|Unit name|Language code|Link type|Custom link}}
Unit name— in-game unit name in English.Link type— ignore to get link in a form of[[link/langcode|text]]; insert any text to get link in a form of[[link]].Custom link— text to replace a link in the default link type to get[[Custom link/langcode|text]]. Useful if the article title differs from the unit name in the game (e.g. Stinger (unit)).
The language codes are:
- "en" — for pages in English (pages that are not language subpages)
- "de" — for /de subpages (German)
- "es" — for /es subpages (Spanish)
- "pt-br" — for /pt-br subpages (Portuguese)
- "fr" — for /fr subpages (French)
- "it" — for /it subpages (Italian)
- "ja" — for /ja subpages (Japanese)
- "pl" — for /pl subpages (Polish)
- "ru" — for /ru subpages (Russian)
- "zh-hans" — for /zh-hans subpages (Chinese, Simplified)
- "zh-hant" — for /zh-hant subpages (Chinese, Traditional)


