Used by {{lect}}
.
local export = {}
local m_languages = require("Module:languages")
function export.show(frame)
local params = {
= { required = true },
= { required = true, list = true }
}
local args = require("Module:parameters").process(frame:getParent().args, params)
local lang = args
local lect = args
local lectNames = {}
if mw.title.getCurrentTitle().nsText == "Template" then
if not lang then
lang = "en"
end
if not lect then
lect = { "en-GB", "en-US" }
end
end
lang = m_languages.getByCode(lang)
or require("Module:families").getByCode(lang)
or m_languages.err(lang, 1)
for i in pairs(lect) do
local lectName = m_languages.getByCode(lect, nil, true)
or m_languages.err(lect, i + 1)
table.insert(lectNames, lectName:getCanonicalName())
end
local output = { table.concat(lectNames, ', ') }
return table.concat(output)
end
return export