Module:auto cat: Difference between revisions

Jump to navigation Jump to search
ਕੋਈ ਸੋਧ ਸਾਰ ਨਹੀਂ
No edit summary
Tag: Reverted
No edit summary
Tag: Reverted
Line 88: Line 88:


local function hydrate_pattern_pos(out_patterns, p_lua, p_categories)
local function hydrate_pattern_pos(out_patterns, p_lua, p_categories)
for l_code, l_data in pairs(d_languages) do
for _, pos in ipairs(d_pos) do
    for _, pos in ipairs(d_pos) do
        local p_out_cats = {}
        local p_out_cats = {}
        for _, p_cat in ipairs(p_categories) do
        for _, p_cat in ipairs(p_categories) do
            table.insert(p_out_cats, replace(p_cat, {["^%%pos"] = capitalize(pos), ["%%pos"] = pos}))
            table.insert(p_out_cats, replace(p_cat, {["%%l"] = l_data.name, ["%%c"] = l_code, ["^%%pos"] = capitalize(pos), ["%%pos"] = pos}))
        end
        end
        table.insert(out_patterns, to_pattern(replace(p_lua, {["^%%pos"] = capitalize(pos), ["%%pos"] = pos}), p_out_cats))
        table.insert(out_patterns, to_pattern(replace(p_lua, {["^%%pos"] = capitalize(pos), ["%%pos"] = pos}), p_out_cats))
    end
     end
     end
end
end

Navigation menu