local export = {}
local m_languages = require("Module:languages")
local m_links = require("Module:links")
local m_qual = require("Module:qualifier")
function export.nyms(frame)
local params = {
= {required = true, default = "und"},
= {list = true, allow_holes = true, required = false},
= {list = true, allow_holes = true},
= {list = true, allow_holes = true},
= {list = true, allow_holes = true}
}
local args = require("Module:parameters").process(frame:getParent().args, params)
local nym_type = frame.args
local lang = m_languages.getByCode(args) or m_languages.err(args, 1)
local maxindex = math.max(args.maxindex, args.maxindex, args.maxindex)
if maxindex < 1 then
return "<span class=\"nyms " .. nym_type .. "\"><span class=\"defdate\">" ..
mw.getContentLanguage():ucfirst(nym_type) ..
":</span> " .. "<small></small>" ..
"]" ..
"</span>"
else
for i = 1, maxindex do
args = m_links.full_link{ lang = lang, term = args, alt = args, tr = args }
if args then
args = args .. " " .. m_qual.format_qualifier({args})
end
end
return "<span class=\"nyms " .. nym_type .. "\"><span class=\"defdate\">" ..
mw.getContentLanguage():ucfirst(nym_type) .. (maxindex > 1 and "s" or "") ..
":</span> " .. table.concat(args, ", ") .. "</span>"
end
end
return export