|
|
| (7 intermediate revisions by 4 users not shown) |
| Line 1: |
Line 1: |
| <onlyinclude>{{#if:{{{bare|}}}
| | {{#if: {{{bare|}}} |
| |{{fullurl:{{FULLPAGENAME}}|uselang={{{1}}}{{#if:{{{action|}}}|&{{{action}}}}}}} | | | {{fullurl:{{FULLPAGENAME}}|uselang={{lc:{{{1|}}}}}{{#if: {{{action|}}} |
| |[{{fullurl:{{FULLPAGENAME}}|uselang={{{1}}}}} {{{text|{{#language:{{{1}}}}}}}}] | | | &{{{action|}}} |
| }}</onlyinclude> | | }}}} |
| | | | <span class="plainlinks">[{{fullurl:{{FULLPAGENAME}}|uselang={{lc:{{{1}}}}}}}{{#if: {{{action|}}} |
| Takes a mandatory unnamed parameter containing a [[m:List of Wikipedias|language code]]. Returns a link to the corresponding language version of the page it's used on.
| | | &{{{action|}}} |
| | | }} <bdi {{#if: {{{text|}}}|| lang="{{lc:{{{1|}}}}}" }} title="{{#language:{{lc:{{{1|}}}}}|{{Int:Lang}}}}">{{#if: {{{text|}}} |
| The text of the link defaults to the language's [[w:autonym|autonym]], and the optional named parameter {{para|text}} can be used to replaced it.
| | | {{{text|}}} |
| | | | {{#language:{{lc:{{{1|}}}}}}} |
| If the dummy parameter {{para|bare}} is present, only the target link will be returned.
| | }}</bdi>]</span> |
| | | }}<noinclude>{{Documentation}}</noinclude> |
| The content of the optional named parameter {{para|action}} will be appended to the URL with a leading "&".
| |
| | |
| Uses only [[mw:Help:Magic words|magic words]], should work on any MediaWiki installation.
| |
| | |
| == Examples ==
| |
| * {{tlc|UselangLink|ja}} yields {{UselangLink|ja}}
| |
| * {{tlc|UselangLink|2=ja|3=text=Japanese}} yields {{UselangLink|ja|text=Japanese}}
| |
| * {{tlc|UselangLink|2=ja|3=bare=yes}} yields {{UselangLink|ja|bare=yes}}
| |
| * {{tlc|UselangLink|INVALID}} yields {{UselangLink|INVALID}}
| |
| * {{tlc|UselangLink|2=ja|3=bare=yes|4=action=edit}} yields {{UselangLink|ja|bare=yes|action=action=edit}}
| |
| * {{tlc|UselangLink|2=ja|3=bare=yes|4=action=edit}} yields {{UselangLink|ja|bare=yes|action=action=edit§ion=1}}
| |
| * {{tlc|UselangLink|2=ja|3=bare=yes|4=action=edit}} yields {{UselangLink|ja|bare=yes|action=action=history}}
| |
| | |
| [[category:helper templates]]
| |
| [[category:internationalization templates]]
| |