Module:User:Kephir/test1

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 "" .. "Native: " .. mw.text.nowiki(native_msg) .. "Interface: " .. mw.text.nowiki(iface_msg) .. "English: " .. mw.text.nowiki(english_msg) .. "" end return export