Template:UselangLink: Difference between revisions
Template page
More actions
growing old I am |
removed ugly arrow |
||
| Line 1: | Line 1: | ||
<onlyinclude>{{#if:{{{bare|}}} | <onlyinclude>{{#if:{{{bare|}}} | ||
|{{fullurl:{{FULLPAGENAME}}|uselang={{{1}}}{{#if:{{{action|}}}|&{{{action}}}}}}} | |{{fullurl:{{FULLPAGENAME}}|uselang={{{1}}}{{#if:{{{action|}}}|&{{{action}}}}}}} | ||
|[{{fullurl:{{FULLPAGENAME}}|uselang={{{1}}}}}{{#if:{{{action|}}}|&{{{action}}}}} {{{text|{{#language:{{{1}}}}}}}}] | |<span class="plainlinks">[{{fullurl:{{FULLPAGENAME}}|uselang={{{1}}}}}{{#if:{{{action|}}}|&{{{action}}}}} {{{text|{{#language:{{{1}}}}}}}}]</span> | ||
}}</onlyinclude> | }}</onlyinclude> | ||
Revision as of 16:53, 19 March 2010
Takes a mandatory unnamed parameter containing a language code. Returns a link to the corresponding language version of the page it's used on.
The text of the link defaults to the language's autonym, and the optional named parameter |text= can be used to replaced it.
If the dummy parameter |bare= is present, only the target link will be returned.
The content of the optional named parameter |action= will be appended to the URL with a leading "&".
Uses only magic words, should work on any MediaWiki installation.
Examples
{{UselangLink|ja}}yields 日本語{{UselangLink|ja|text=Japanese}}yields Japanese{{UselangLink|ja|bare=yes}}yields https://wiki.neody.land/index.php?title=Template:UselangLink&uselang=ja{{UselangLink|INVALID}}yields invalid{{UselangLink|ja|bare=yes|action=edit}}yields https://wiki.neody.land/index.php?title=Template:UselangLink&uselang=ja&action=edit{{UselangLink|ja|bare=yes|action=edit}}yields https://wiki.neody.land/index.php?title=Template:UselangLink&uselang=ja&action=edit§ion=1{{UselangLink|ja|bare=yes|action=edit}}yields https://wiki.neody.land/index.php?title=Template:UselangLink&uselang=ja&action=history