Difference between revisions of "Template:If lang link"

From Kerbal Space Program Wiki
Jump to: navigation, search
m
m (+use lang template;)
Line 1: Line 1:
<includeonly>[[{{{1}}}{{#if: {{{force|}}}|/{{{force}}}|{{if lang}}}}|{{{2|{{{1}}}}}}]]</includeonly><noinclude>
+
<includeonly>[[{{{1}}}{{#if: {{{force|}}}|/{{{force}}}|{{if lang}}}}|{{lang|en={{{2|{{{en|{{{1}}}}}}}}}|ar={{{ar|}}}|cs={{{cs|}}}|da={{{da|}}}|de={{{de|}}}|es={{{es|}}}|fi={{{fi|}}}|fr={{{fr|}}}|he={{{he|}}}|hu={{{hu|}}}|it={{{it|}}}|ja={{{ja|}}}|ko={{{ko|}}}|nl={{{nl|}}}|no={{{no|}}}|pl={{{pl|}}}|pt={{{pt|}}}|pt-br={{{pt-br|}}}|ro={{{ro|}}}|ru={{{ru|}}}|sv={{{sv|}}}|tr={{{tr|}}}|zh={{{zh|}}}|zh-cn={{{zh-cn|}}}|zh-tw={{{zh-tw|}}}|force={{{force|}}}}}]]</includeonly><noinclude>
----
+
Creates a link which automatically links to the article in the same language. Requires one parameter to the link target. Optionally it allows another link text in the same languages supported by {{Tl|lang}}.
Creates a link which automatically links to the article in the same language. Has one parameter to the link target.
 
  
 
<tt><nowiki>{{if lang link|Main Page}}</nowiki></tt> would create a link to the [[Main Page]] if on an English page and to [[Main Page/ru]] if on an Russian page.
 
<tt><nowiki>{{if lang link|Main Page}}</nowiki></tt> would create a link to the [[Main Page]] if on an English page and to [[Main Page/ru]] if on an Russian page.
  
 
{{Parameter Table|name=both|parameters=
 
{{Parameter Table|name=both|parameters=
{{ParameterRow|1|Target's name}}
+
{{Parameter Row|1|Target's name}}
{{ParameterRow|2|Visible link text.|{{{1}}}}}
+
{{Parameter Row|2|name2=en|Visible link text.|{{{1}}}}}
{{ParameterRow|force|Forced language target|Not set}}
+
{{Parameter Row|force|Forced language target|Not set}}
}}</noinclude>
+
{{Parameter Row|de|name2=pl|name3=…|Visible link text in other languages.|Not set}}
 +
}}
 +
 
 +
[[Category:Language templates]]</noinclude>

Revision as of 01:22, 15 December 2013

Creates a link which automatically links to the article in the same language. Requires one parameter to the link target. Optionally it allows another link text in the same languages supported by {{lang}}.

{{if lang link|Main Page}} would create a link to the Main Page if on an English page and to Main Page/ru if on an Russian page.

Template:Parameter Table