မာတိကာသို့ ခုန်သွားရန်

မော်ဂျူး:languages/bySortkeyModule

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

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

return function(sortkeyModule)
	local m_redirect = mw.loadData("Module:sortkey-redirect/data")
	local langs = {}
	
	for code, data in pairs(require("Module:languages/alldata")) do
		if data.sort_key == sortkeyModule then
			langs[code] = data
		elseif data.sort_key == "sortkey-redirect" and m_redirect[code] then
			for scriptCode, sortkeyRedirectData in pairs(m_redirect[code]) do
				if type(sortkeyRedirectData) == "table" and sortkeyRedirectData.module == sortkeyModule then
					langs[code] = data
				end
			end
		end
	end
	
	local result = {}
	local i = 0
	for code, data in pairs(langs) do
		i = i + 1
		result[i] = require("Module:languages").makeObject(code, data)
	end
	
	return result
end