Module:qhv-noun: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 15: Line 15:


local lang = require("Module:languages").getByCode("qhv")
local lang = require("Module:languages").getByCode("qhv")
local sorted = lang:makeSortKey(PAGENAME)


local export = {}
local export = {}
Line 34: Line 33:
["ir"] = "c-5", ["rjin"] = "p-5",
["ir"] = "c-5", ["rjin"] = "p-5",
}
}
local function ncategories(categories)
local out_categories = {}
for key, cat in ipairs(categories) do
out_categories[key] = "[[Category:" .. cat .. "|" .. sorted .. "]]"
end
return table.concat(out_categories, "")
end


function export.detect_decl(word, number, class, reanalyzed)
function export.detect_decl(word, number, class, reanalyzed)
Line 193: Line 183:
|}]=]
|}]=]


return (gsub(wikicode, "{{{([a-z0-9_]+)}}}", repl)) .. ncategories(pass.categories)
return (gsub(wikicode, "{{{([a-z0-9_]+)}}}", repl)) .. require("Module:utilities").format_categories(lang, pass.categories)
end
end




return export
return export