Template:UselangLink: Difference between revisions
More actions
i18n |
No edit summary |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
{{#if:{{{bare|}}}|{{fullurl:{{FULLPAGENAME}}|uselang={{{1}}}{{#if:{{{action|}}}|&{{{action}}}}}}}|<span class="plainlinks">[{{fullurl:{{FULLPAGENAME}}|uselang={{{1}}}}}{{#if:{{{action|}}}|&{{{action}}}}} {{{text|{{language|{{{1}}}}}}}}]</span>}}<noinclude>{{ | {{#if: {{{bare|}}} | ||
| {{fullurl:{{FULLPAGENAME}}|uselang={{lc:{{{1|}}}}}{{#if: {{{action|}}} | |||
| &{{{action|}}} | |||
}}}} | |||
| <span class="plainlinks">[{{fullurl:{{FULLPAGENAME}}|uselang={{lc:{{{1}}}}}}}{{#if: {{{action|}}} | |||
| &{{{action|}}} | |||
}} <bdi {{#if: {{{text|}}}|| lang="{{lc:{{{1|}}}}}" }} title="{{#language:{{lc:{{{1|}}}}}|{{Int:Lang}}}}">{{#if: {{{text|}}} | |||
| {{{text|}}} | |||
| {{#language:{{lc:{{{1|}}}}}}} | |||
}}</bdi>]</span> | |||
}}<noinclude>{{Documentation}}</noinclude> | |||
Latest revision as of 22:01, 12 July 2020
Returns a link to the corresponding language version of the page it's used on.
Usage
{{UselangLink |1= }}
Template parameters
| Parameter | Description | Default | Status | |
|---|---|---|---|---|
1 | empty | optional | ||
Additional information
The template is intended to be used in the following namespaces: no namespace specified
The template is intended to be used by the following user groups: no user group specified
See also
- {{Multilingual link}} – choose link to Wikipedia article in the user interface language
Description
Takes a mandatory unnamed parameter containing a language code.
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=action=edit}}yields https://wiki.neody.land/index.php?title=Template:UselangLink&uselang=ja&action=edit{{UselangLink|ja|bare=yes|action=action=edit}}yields https://wiki.neody.land/index.php?title=Template:UselangLink&uselang=ja&action=edit§ion=1{{UselangLink|ja|bare=yes|action=action=edit}}yields https://wiki.neody.land/index.php?title=Template:UselangLink&uselang=ja&action=history