Module:lect

local export = {}

local m_languages = require("Module:languages")

function export.show(frame) local params = { [1] = { required = true }, [2] = { required = true, list = true } }	local args = require("Module:parameters").process(frame:getParent.args, params) local lang = args[1] local lect = args[2] 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[i], nil, true) or m_languages.err(lect[i], i + 1) table.insert(lectNames, lectName:getCanonicalName) end local output = { table.concat(lectNames, ', ') } return table.concat(output) end

return export