Jump to content

မေႃႇၵျူး:languages/iterateAll

လုၵ်ႉတီႈ ဝိၵ်ႇသျိၼ်ႇၼရီႇ မႃး

require("Module:languages/iterateAll")()

This function is expensive

Returns a table containing Language objects for all languages, sorted by code.

This function searches through the whole database of languages, and is therefore relatively resource-intensive. It should be used sparingly.


return function ()
	mw.incrementExpensiveFunctionCount()
	local m_languages = require("Module:languages")
	local m_data = mw.loadData("Module:languages/data/all")
	local func, t, var = pairs(m_data)
	
	return function()
		local code, data = func(t, var)
		return m_languages.makeObject(code, data)
	end
end