Module:languages/byTranslitModule
Documentation for this module may be created at Module:languages/byTranslitModule/doc
return function(translitModule)
local makeObject = require("Module:languages").makeObject
local langs = {
n = 0,
add = function(self, code, data)
if not self[1] or require("Module:fun").all(
function (lang)
return lang:getCode() ~= code
end,
self) then
self.n = self.n + 1
self[self.n] = makeObject(code, data)
end
end
}
local m_redirect = mw.loadData("Module:translit-redirect/data")
local function iterate(list)
for code, data in pairs(list) do
if data.translit_module == translitModule then
langs:add(code, data)
elseif data.translit_module == "translit-redirect" and m_redirect[code] then
for scriptCode, translitRedirectData in pairs(m_redirect[code]) do
if type(translitRedirectData) == "table" and translitRedirectData.module == translitModule then
langs:add(code, data)
end
end
end
end
end
iterate(mw.loadData("Module:languages/data2"))
for letter in string.gmatch("abcdefghijklmnopqrstuvwxyz", ".") do
iterate(mw.loadData("Module:languages/data3/" .. letter))
end
iterate(mw.loadData("Module:languages/datax"))
return langs
end