မော်ဂျူး:list description

အဝ်ႏ ဝိစ်သိဉ်နရီ ကို

Documentation for this module may be created at မော်ဂျူး:list description/doc

local export = {}

function export.show(frame)
	local title = mw.title.getCurrentTitle()
	local rootpagename = title.rootText
	local isSubpage = title.isSubpage
	local subpagename = title.subpageText
	mw.log(rootpagename, isSubpage, subpagename)
	
	local lang, canonicalName
	if isSubpage then
		lang = require("Module:languages").getByCode(subpagename)
	end
	
	local listName, matches
	if rootpagename then
		listName, matches = mw.ustring.gsub(rootpagename, "list:", "")
	end
	
	local description
	local category = ""
	if lang then
		if matches == 1 then
			description =  "ယိုနဝ်ꩻ "  .. lang:getCanonicalName() .. " ဘာႏသာႏကိုကအဝ်ႏဒါႏ  " .. listName .. "စာႏရင်ꩻတဗာႏ ဒျာႏသွူ။"
			if mw.ustring.match(listName, "လဲတ်တိဉ်အက္ခရာႏ") then
				category = "[[Category:လဲတ်တိဉ်အက္ခရာႏ တမ်းပလေက်ဖုံႏ]]"
			end
		else
			description = "ယိုနဝ်ꩻ "  .. lang:getCanonicalName() .. " ဘာႏသာႏကိုကအဝ်ႏဒါႏ စာႏရင်ꩻတဗာႏဒျာႏသွူ။"
		end
	end
	
	if description then
		return description .. category
	end
end

return export