Module:ku-regional

local export = {}

-- This module implements.

-- The main entry point. -- This is the only function that can be invoked from a template. function export.show(frame) local langs = {"kmr", "ckb", "sdh", "lki", "zza", "hac"} local params = {} for _, langcode in ipairs(langs) do		params[langcode] = {list = true} params[langcode .. "\1tr"] = {list = true, allow_holes = true} end

local parargs = frame:getParent.args local args = require("Module:parameters").process(parargs, params) local text = {'{| class="floatright wikitable" style="text-align: center;"'} for _, langcode in ipairs(langs) do		local terms = args[langcode] if #terms > 0 then local lang = require("Module:languages").getByCode(langcode) local langname = lang:getCanonicalName table.insert(text, "|-") table.insert(text, "! " .. langname) local formatted_terms = {} for i, term in ipairs(terms) do table.insert(formatted_terms, require("Module:links").full_link { lang = lang, term = term, tr = args[langcode .. "tr"][i] }) end table.insert(text, "| " .. table.concat(formatted_terms, ", ")) end end table.insert(text, "|}") return table.concat(text, "\n") end

return export