Template:RelevantLanguage: Difference between revisions

From translatewiki.net
Jump to navigation Jump to search
(another method to get the translation language of current page)
("/qqq" and "/qqx" are not relevant but may be returned by "#translation:", so treat it like the default empty value)
 
(2 intermediate revisions by the same user not shown)
Line 2: Line 2:
 
|Template = {{UILANGCODE}}
 
|Template = {{UILANGCODE}}
 
|Portal = {{lcfirst:{{BASEPAGENAME}}}}
 
|Portal = {{lcfirst:{{BASEPAGENAME}}}}
|#default = {{#ifeq: {{SUBPAGENAME}} | qqq
+
|#default = {{#switch: {{#translation:}}
| {{UILANGCODE}}
+
||/qqq|/qqx = {{UILANGCODE}}
 
|#default = {{#sub:{{#translation:}}|1}}
| {{#ifeq: {{NAMESPACE}}:{{BASEPAGENAME}}/{{SUBPAGENAME}} | {{FULLPAGENAME}}
 
| {{SUBPAGENAME}}
 
| {{#if: {{#translation:}}
 
| {{#sub:{{#translation:}}|1}}
 
| {{UILANGCODE}}
 
}}
 
}}
 
 
}}
 
}}
 
}}<noinclude>{{Doc}}</noinclude>
 
}}<noinclude>{{Doc}}</noinclude>

Latest revision as of 14:45, 6 September 2022

en

Test Template Info-Icon - Version (2).svg
The documentation of this template is included from its /doc subpage. [Edit]

This template is designed to be used in Template:Msg-mw and the like. It returns the subpagename of the current page (i.e. the current translation target's language code), and falls back to the user's UI language code.

Syntax:
  • {{RelevantLanguage}}