Module:auto cat/data: Difference between revisions

ਕੋਈ ਸੋਧ ਸਾਰ ਨਹੀਂ
(Fixed sorting)
No edit summary
Line 486: Line 486:
local subcats_topic = {"Topics by language"}
local subcats_topic = {"Topics by language"}
if type(supertopics) == "string" then
if type(supertopics) == "string" then
table.insert(subcats, "%c:" .. capitalize(supertopics) .. "|" .. supertopics)
table.insert(subcats, "%c:" .. capitalize(supertopics) .. "|" .. subtopic)
table.insert(subcats_topic, capitalize(supertopics) .. " topic by language")
table.insert(subcats_topic, capitalize(supertopics) .. " topic by language")
elseif type(supertopics) == "table" then
elseif type(supertopics) == "table" then
for _, supertopic in ipairs(supertopics) do
for _, supertopic in ipairs(supertopics) do
table.insert(subcats, "%c:" .. capitalize(supertopic) .. "|" .. supertopic)
table.insert(subcats, "%c:" .. capitalize(supertopic) .. "|" .. subtopic)
table.insert(subcats_topic, capitalize(supertopic) .. " topic by language")
table.insert(subcats_topic, capitalize(supertopic) .. " topic by language")
end
end