"اس ماڈیول کی دستاویز ماڈیول:nyms/دستاویز پر بنائی جاسکتی ہے"

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 = {
		[1] = {required = true, default = "und"},
		[2] = {list = true, allow_holes = true, required = true},
		
		["alt"] = {list = true, allow_holes = true},
		["tr"] = {list = true, allow_holes = true},
		["q"] = {list = true, allow_holes = true}
	}
	
	local args = require("Module:parameters").process(frame:getParent().args, params)
	
	local lang = m_languages.getByCode(args[1]) or m_languages.err(args[1], 1)
	
	local maxindex = math.max(args[2].maxindex, args["alt"].maxindex, args["tr"].maxindex)
	
	for i = 1, maxindex do
		args[2][i] = m_links.full_link{ lang = lang, term = args[2][i], alt = args["alt"][i], tr = args["tr"][i] }
		if args["q"][i] then
			args[2][i] = args[2][i] .. " " .. m_qual.format_qualifier({args["q"][i]})
		end
	end
	
	return "<span class=\"nyms " .. frame.args[1] .. "\">'''[[وکی لغت:معنوی رشتے|" .. mw.getContentLanguage():ucfirst(frame.args[1]) .. "]]''': " .. table.concat(args[2], ", ") .. "</span>"
end


return export