Template:RelevantLanguage: Difference between revisions

From translatewiki.net
Jump to navigation Jump to search
(another method to get the translation language of current page)
(exclude some other subpagenames that are not "relevant" as language codes)
Line 2: Line 2:
 
|Template = {{UILANGCODE}}
 
|Template = {{UILANGCODE}}
 
|Portal = {{lcfirst:{{BASEPAGENAME}}}}
 
|Portal = {{lcfirst:{{BASEPAGENAME}}}}
|#default = {{#ifeq: {{SUBPAGENAME}} | qqq
+
|#default = {{#switch: {{SUBPAGENAME}}
| {{UILANGCODE}}
+
|doc|qqq|qqx|sandbox|temp|test = {{UILANGCODE}}
| {{#ifeq: {{NAMESPACE}}:{{BASEPAGENAME}}/{{SUBPAGENAME}} | {{FULLPAGENAME}}
+
|#default= {{#ifeq: {{NAMESPACE}}:{{BASEPAGENAME}}/{{SUBPAGENAME}} | {{FULLPAGENAME}}
 
| {{SUBPAGENAME}}
 
| {{SUBPAGENAME}}
 
| {{#if: {{#translation:}}
 
| {{#if: {{#translation:}}

Revision as of 14:26, 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}}