Module:utilities: Difference between revisions

Undo revision 320503 by Sware (talk)
No edit summary
(Undo revision 320503 by Sware (talk))
Tag: Undo
 
(5 intermediate revisions by the same user not shown)
Line 115: Line 115:
local out_categories = {}
local out_categories = {}
for key, cat in ipairs(categories) do
for key, cat in ipairs(categories) do
out_categories[key] = "[[Category:" .. table.concat(cat) .. (sort_key and "|" .. sort_key or "") .. "]]"
out_categories[key] = "[[Category:" .. cat .. (sort_key and "|" .. sort_key or "") .. "]]"
end
end
Line 170: Line 170:


function export.catfix(lang, sc)
function export.catfix(lang, sc)
if not lang then
require("Module:debug").track("catfix/no lang")
return nil
elseif type(lang) ~= "table" then
require("Module:debug").track("catfix/lang not table")
return nil
end
local canonicalName = lang:getCanonicalName() or error('The first argument to the function "catfix" should be a language object from Module:languages.')
local canonicalName = lang:getCanonicalName() or error('The first argument to the function "catfix" should be a language object from Module:languages.')