Module:User:Kephir/test1
Appearance
- The following documentation is located at Module:User:Kephir/test1/documentation. [edit]
- Useful links: root page • root page’s subpages • links • transclusions • testcases • sandbox
- Native:
- {{GENDER:USER|Esti usuariu|Esta usuaria}} tien un conocimientu [[LEVEL LINK|profesional]] d'[[LANG LINK|asturianu]].
- Interface:
- This user has [[LEVEL LINK|professional]] knowledge of [[LANG LINK|asturianu]].
- English:
- This user has professional knowledge of Asturian.
local export = {}
local english_msgs = {
["0"] = "This user does not speak %s at all.";
["1"] = "This user knows %s at a basic level.";
["2"] = "This user speaks %s at an intermediate level.";
["3"] = "This user has an advanced understanding of %s.";
["4"] = "This user speaks %s at a near-native level.";
["5"] = "This user has professional knowledge of %s.";
["N"] = "%s is this user's mother tongue.";
}
function export.babble(langcode, level)
if type(langcode) == 'table' then
langcode, level = langcode.args[1], langcode.args[2]
end
level = level or "N"
local lang = require("Module:languages").getByCode(langcode)
local english_langname = lang and lang:getCanonicalName() or ("[" .. langcode .. "]")
local iface_langname = mw.language.fetchLanguageName(langcode, mw.getCurrentFrame():callParserFunction("int", "uselang"))
local native_msg = tostring(mw.message.new(("babel-%s-n/%s"):format(level, langcode), "LEVEL LINK", "LANG LINK", "???", "USER"))
local iface_msg = tostring(mw.getCurrentFrame():callParserFunction("int", ("babel-%s"):format(level), "LEVEL LINK", "LANG LINK", iface_langname, "USER"))
local english_msg = english_msgs[level]:format(english_langname)
return "<dl>" ..
"<dt>Native: <dd>" .. mw.text.nowiki(native_msg) ..
"<dt>Interface: <dd>" .. mw.text.nowiki(iface_msg) ..
"<dt>English: <dd>" .. mw.text.nowiki(english_msg) ..
"</dl>"
end
return export