Jump to content

မေႃႇၵျူး:root

လုၵ်ႉတီႈ ဝိၵ်ႇသျိၼ်ႇၼရီႇ မႃး
ထႅမ်းပလဵတ်ႉ ဢၼ်ၼႆႉ တိုၵ်ႉလူဝ်ႇ ၽိုၼ်ၵႅမ်မိုဝ်းမၼ်း။
ၶႅၼ်းတေႃႈ တႅမ်ႈပၼ် ၽိုၼ်ၵႅမ်မိုဝ်း ထႅမ်းပလဵတ်ႉ ဢၼ်ၼႆႉ သေ ၼႄပၼ် လွင်ႈယိူင်းဢၢၼ်း လႄႈ လၢႆးၸႂ်ႉတိုဝ်း ၵႃႈတီႈ ၼႃႈလိၵ်ႈ ၽိုၼ်ၵႅမ်မိုဝ်း သေၵမ်း။

local export = {}

local force_cat = false -- for debugging

function export.categorize(lang, source, roots, ids, sort_key)
	local categories = {}
	
	if lang:getCode() ~= source:getCode() then
		table.insert(categories,
			"ၶေႃႈၵႂၢမ်း " .. lang:getFullName() .. " ဢၼ်ၽႄႈတိူၼ်းမႃးတီႈ " .. source:getCanonicalName())
	end
	
	for index, root in ipairs(roots) do
		if lang:getCode() == source:getCode() then
			table.insert(categories,
				"ၶေႃႈၵႂၢမ်း " .. lang:getFullName() .. " ဢၼ်ပဵၼ် ငိူၼ်ႈငဝ်ႈတိုၼ်း ၶွင် " .. root .. (ids[index] and " (" .. ids[index] .. ")" or ""))
		else
			table.insert(categories,
				"ၶေႃႈၵႂၢမ်း " .. lang:getFullName() .. " ဢၼ်ၽႄႈတိူၼ်းမႃးတီႈ " .. source:getCanonicalName() ..
						" " .. root .. (ids[index] and " (" .. ids[index] .. ")" or ""))
		end
	end
	
	return require("Module:utilities").format_categories(categories, lang, sort_key, nil, force_cat)
end

function export.show(frame)
	local params = {
		[1] = { required = true, type = "language" },
		[2] = { required = true, type = "language" },
		[3] = { required = true, list = true },
		["id"] = { list = true, allow_holes = true },
		["sort"] = {},
	}
	
	local args = require("Module:parameters").process(frame:getParent().args, params)
	return export.categorize(args[1], args[2], args[3], args.id, args.sort)
end

return export