Difference between revisions of "Template:translated link"
m (fix #ifexist condition) |
m (when English text is unavailable, fallback to text: this makes more sense, e.g. in "click here (eng.)" => here should be translated regardless of whether the article is translated or not) |
||
Line 6: | Line 6: | ||
| {{#if: {{{english text|}}} | | {{#if: {{{english text|}}} | ||
| [[{{{1|}}}|{{{english text}}}]] | | [[{{{1|}}}|{{{english text}}}]] | ||
− | | [[{{{1|}}}]] | + | | {{#if: {{{text|}}} |
+ | | [[{{{1|}}}|{{{text|}}}]] | ||
+ | | [[{{{1|}}}]] | ||
+ | }} | ||
}} {{#switch: {{{2|}}} | }} {{#switch: {{{2|}}} | ||
|Dansk = (eng.) | |Dansk = (eng.) |
Revision as of 09:08, 31 January 2020
[edit] [ ] Template documentation
This template creates a link either to the translated page (if it exists), or to the English page with an (Eng.) suffix. The (Eng.) suffix is localised.
It's used as follows:
{{translated link|page title|language name|text=link text|english text=untranslated link text}}
To remove the (Eng.) suffix, add the |no marker=1
argument:
{{translated link|page title|language name|text=link text|english text=untranslated link text|no marker=1}}
Not all pages can be translated at once. For usability, it's often more useful to add a link to an English page than to leave the link red. However, in this case, translators will have to go through all the pages, find the English links and replace them with Ukrainian links.
This template automatically replaces English links only translated ones become available, thus having the best of the both worlds.
Examples
{{translated link|love.thread|Українська}}
becomes love.thread{{translated link|lua-enet|Українська}}
becomes lua-enet (англ.){{translated link|lua-enet|Українська|no marker=1}}
becomes lua-enet{{translated link|love.thread|עברית}}
becomes lua-enet (אנגלית){{translated link|Main Page|Indonesia}}
becomes Main Page{{translated link|love.thread|Indonesia}}
becomes love.thread (Ingg.){{translated link|Main Page|日本語}}
becomes Main Page{{translated link|love.thread|日本語}}
becomes love.thread{{translated link|Main Page|正體中文}}
becomes Main Page{{translated link|love.thread|正體中文}}
becomes love.thread(英文){{translated link|Main Page|한국어}}
becomes Main Page{{translated link|lua-enet|한국어}}
becomes lua-enet(영어)
Examples with text:
«Натисніть {{translated link|love.thread|Українська|text=сюди}}»
becomes «Натисніть сюди»«А потім {{translated link|lua-enet|Українська|text=сюди}}»
becomes «А потім сюди (англ.)»
Examples with english text:
{{translated link|love.thread|Українська|text=I'm translated|english text=I'm untranslated}}
becomes I'm translated{{translated link|lua-enet|Українська|text=I'm translated|english text=I'm untranslated}}
becomes I'm untranslated (англ.)
The above documentation is transcluded from Template:translated link/doc. (edit | history) Editors can experiment in this template's sandbox (create) and testcases (create) pages. Please add categories and interwikis to the /doc subpage. Subpages of this template. |