Module:languages/data/all

Wiktionary වෙතින්

This module combines data from the language data modules into a single table. It should only be used in Lua modules that need to look at the data for all languages, such as Wiktionary:List of languages. It should not be used in entries, because its memory footprint is huge.

See Wiktionary:Grease pit/2013/November#Module:languages.

See also[සංස්කරණය]


local char = string.char

local modules = {
	["Module:languages/data/2"] = true,
	["Module:languages/data/exceptional"] = true,
}
for i = 1, 26 do
	modules["Module:languages/data/3/" .. char(0x60+i)] = true
end

local m = {}

for mname in pairs(modules) do
	for key, value in pairs(require(mname)) do
		if value[4] == "All" then
			local scripts = {}
			for script in pairs(require("Module:scripts/data")) do
				table.insert(scripts, script)
			end
			value[4] = scripts
		end
		m[key] = value
	end
	local xname = mname .. "/extra"
	for lkey, lvalue in pairs(require(xname)) do
		if m[lkey] then
			for key, value in pairs(lvalue) do
				m[lkey][key] = lvalue[key]
			end
		end
	end
end

return m
"https://si.wiktionary.org/w/index.php?title=Module:languages/data/all&oldid=165330" වෙතින් සම්ප්‍රවේශනය කෙරිණි