Module:languages/data/all

Hello, you have come here looking for the meaning of the word Module:languages/data/all. In DICTIOUS you will not only get to know all the dictionary meanings for the word Module:languages/data/all, but we will also tell you about its etymology, its characteristics and you will know how to say Module:languages/data/all in singular and plural. Everything you need to know about the word Module:languages/data/all you have here. The definition of the word Module:languages/data/all will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofModule:languages/data/all, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.

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 string = string
local table = table

local find = string.find
local format = string.format
local gsub = string.gsub
local next = next
local require = require

local all_scripts
do
	local scripts, n = {}, 0
	for script in next, require("Module:scripts/data") do
		n = n + 1
		scripts = script
	end
	table.sort(scripts)
	all_scripts = table.concat(scripts, ",")
end

local modules = {
	"Module:languages/data/2",
	"Module:languages/data/exceptional"
}

local data = {}

for i = 1, 28 do
	local mname = modules or format("Module:languages/data/3/%c", 0x5E + i)
	for key, value in next, require(mname) do
		-- Handle the special script codes "All" and "Hants".
		local value4 = value
		if value4 == "All" then
			value = all_scripts
		elseif value4 and find(value4, "Hants", 1, true) then
			value = gsub(value4, "Hants", "Hani,Hant,Hans")
		end
		data = value
	end
	for lkey, lvalue in next, require(mname .. "/extra") do
		local lkey_data = data
		if lkey_data then
			for key, value in next, lvalue do
				lkey_data = value
			end
		end
	end
end

return data