मॉड्यूल:category tree/poscatboiler/data/lang-specific
"इस मॉड्यूल हेतु प्रलेख मॉड्यूल:category tree/poscatboiler/data/lang-specific/doc पर बनाया जा सकता है"
-- This module contains language-specific labels and handlers.
local langs_with_modules = {
["acw"] = true,
["afb"] = true,
["ajp"] = true,
["ams"] = true,
["ang"] = true,
["apc"] = true,
["ar"] = true,
["ary"] = true,
["arz"] = true,
["az"] = true,
["be"] = true,
["bg"] = true,
["ceb"] = true,
["cs"] = true,
["cu"] = true,
["de"] = true,
["el"] = true,
["en"] = true,
["enm"] = true,
["es"] = true,
["eu"] = true,
["fa"] = true,
["fax"] = true,
["fi"] = true,
["goh"] = true,
["grk-pro"] = true,
["he"] = true,
["hi"] = true,
["hil"] = true,
["ilo"] = true,
["ira-pro"] = true,
["it"] = true,
["ja"] = true,
["kzg"] = true,
["la"] = true,
["mk"] = true,
["mt"] = true,
["mvi"] = true,
["ne"] = true,
["nl"] = true,
["nn"] = true,
["ojp"] = true,
["okn"] = true,
["orv"] = true,
["pi"] = true,
["pt"] = true,
["ro"] = true,
["ru"] = true,
["ryn"] = true,
["rys"] = true,
["ryu"] = true,
["sa"] = true,
["sc"] = true,
["sei"] = true,
["tkn"] = true,
["tl"] = true,
["uk"] = true,
["xug"] = true,
["yoi"] = true,
["yox"] = true,
}
--------------------------- Generic driver handler ----------------------------
local function lang_specific_handler(data)
if not data.lang then
return nil
end
local langcode = data.lang:getCode()
if not langs_with_modules[langcode] then
return nil
end
local module = "Module:category tree/poscatboiler/data/lang-specific/" .. data.lang:getCode()
local labels_and_handlers = require(module)
if labels_and_handlers.LABELS then
local retval = labels_and_handlers.LABELS[data.label]
if retval then
if retval.umbrella == nil and retval.umbrella_parents == nil then
retval.umbrella = false
end
retval.module = retval.module or module
return retval
end
end
if labels_and_handlers.HANDLERS then
for _, handler in ipairs(labels_and_handlers.HANDLERS) do
local retval, args_handled = handler(data)
if retval then
if retval.umbrella == nil and retval.umbrella_parents == nil then
retval.umbrella = false
end
retval.module = retval.module or module
return retval, args_handled
end
end
end
end
return {LABELS = {}, HANDLERS = {lang_specific_handler}}