mw.getContentLanguage().code -- Returns the content language.
mw.getCurrentFrame():preprocess("{{PAGELANGUAGE}}") -- Returns the page language.
mw.getCurrentFrame():preprocess( "{{int:Lang}}" ) -- Returns the user language.
Author: gangleri
Description:
Halló,
The benefits of a variable returning the language code of the selected user interface can not be foreseen and all "applications" can not be described here.
Hopefully it should be easy to implement and be available soon.
Regards Reinhardt
Version: unspecified
Severity: enhancement
URL: https://commons.wikimedia.org/wiki/MediaWiki:Lang?uselang=eo
See Also:
- T63695: Selecting a different language should switch the language of the content served
- T59603: Create a {{PAGELANGUAGE}} magic word
Workarounds available:
- For system administrators, installing the UILangCode extension which provides the {{UILANGCODE}} variable
- For system administrators, installing the MyVariables extension which provides the {{USERLANGUAGECODE}} variable
- For system administrators, installing the LanguageCode extension which provides the {{USERLANGUAGE}} variable
- For wiki administrators, using {{int:lang}} after creating all MediaWiki:Lang subpages.
- I'm looking for how to use this task
- but I do not find in this task how to use it
- I tried :
- langs.page_lang = modes.frame:preprocess( "PAGELANGUAGE")
- and langs.page_lang = modes.frame:preprocess( title = "PAGELANGUAGE")
- and langs.user_lang = modes.frame:preprocess( title = "USERLANGUAGECODE")
- But none worked
- You should provide in the description of the task itself the right way to use it
- Thanks in advance for all coders