Difference between revisions of "Template:If lang link"

From Kerbal Space Program Wiki
Jump to: navigation, search
m (+allow en as a substitute for 1;)
m (*replace 'Parameter Row' and 'ParameterRow' by 'Parameter row';)
Line 6: Line 6:
 
== Parameters ==
 
== Parameters ==
 
{{Parameter Table|name=both|parameters=
 
{{Parameter Table|name=both|parameters=
{{Parameter Row|1|Target's name. If not set will use {{{en}}}.}}
+
{{Parameter row|1|Target's name. If not set will use {{{en}}}.}}
{{Parameter Row|2|name2=en|Visible link text.|{{{1}}}}}
+
{{Parameter row|2|name2=en|Visible link text.|{{{1}}}}}
{{Parameter Row|de|name2=pl|name3=…|Visible link text in other languages.|Not set}}
+
{{Parameter row|de|name2=pl|name3=…|Visible link text in other languages.|Not set}}
{{Parameter Row|force|Forced language target. Usually not required, but can be used to test what that template would show in a different language.|Not set}}
+
{{Parameter row|force|Forced language target. Usually not required, but can be used to test what that template would show in a different language.|Not set}}
 
}}
 
}}
  

Revision as of 20:50, 26 November 2014

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.

Parameters

Template:Parameter Table

Examples

Code View
English German Russian
{{if lang link|Mk16 Parachute|ru=Парашют Mk16}} Mk16 Parachute Mk16 Parachute Парашют Mk16
{{if lang link|Kerbol|en=Sun|de=Sonne|ru=Солнце}} Sun Sonne Солнце
{{if lang link|Kerbol|en=Sun|de=Sonne|ru=Солнце|force=de}} Sonne Sonne Sonne