Module:languages/alldata: Difference between revisions

From Linguifex
Jump to navigation Jump to search
No edit summary
No edit summary
 
Line 35: Line 35:
     for key, value in pairs(require(mname)) do
     for key, value in pairs(require(mname)) do
         m[key] = value
         m[key] = value
    end
    local xname = mname:gsub("data", "extradata")
    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
end
end


return m
return m

Latest revision as of 17:36, 8 August 2021

This module formerly contained all language data. Now it simply 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.


local modules = {
    ["Module:languages/data2"] = true,
    ["Module:languages/data3/a"] = true,
    ["Module:languages/data3/b"] = true,
    ["Module:languages/data3/c"] = true,
    ["Module:languages/data3/d"] = true,
    ["Module:languages/data3/e"] = true,
    ["Module:languages/data3/f"] = true,
    ["Module:languages/data3/g"] = true,
    ["Module:languages/data3/h"] = true,
    ["Module:languages/data3/i"] = true,
    ["Module:languages/data3/j"] = true,
    ["Module:languages/data3/k"] = true,
    ["Module:languages/data3/l"] = true,
    ["Module:languages/data3/m"] = true,
    ["Module:languages/data3/n"] = true,
    ["Module:languages/data3/o"] = true,
    ["Module:languages/data3/p"] = true,
    ["Module:languages/data3/q"] = true,
    ["Module:languages/data3/r"] = true,
    ["Module:languages/data3/s"] = true,
    ["Module:languages/data3/t"] = true,
    ["Module:languages/data3/u"] = true,
    ["Module:languages/data3/v"] = true,
    ["Module:languages/data3/w"] = true,
    ["Module:languages/data3/x"] = true,
    ["Module:languages/data3/y"] = true,
    ["Module:languages/data3/z"] = true,
    ["Module:languages/datax"] = true,
}

local m = {}

for mname in pairs(modules) do
    for key, value in pairs(require(mname)) do
        m[key] = value
    end
end

return m