Module:root: Difference between revisions

ਕੋਈ ਸੋਧ ਸਾਰ ਨਹੀਂ
(Created page with "local export = {} local m_languages = require("Module:languages") function export.make_categories(language, source, roots) local categories = {} local root_prefix = (source.proto and "*") or "" for _, root in ipairs(roots) do if language.code == source.code then table.insert(categories, "Category:" .. language.name .. " terms belonging to the root " .. root_prefix .. root .. "") else table.insert(categories, "[[Category:" .. language.name .. " terms der...")
 
No edit summary
Line 6: Line 6:
local root_prefix = (source.proto and "*") or ""
local root_prefix = (source.proto and "*") or ""
for _, root in ipairs(roots) do
for _, root in ipairs(roots) do
if mw.ustring.sub(root, -1) ~= "-" then root = root .. "-" end
if language.code == source.code then
if language.code == source.code then
table.insert(categories, "[[Category:" .. language.name .. " terms belonging to the root " .. root_prefix .. root .. "]]")
table.insert(categories, "[[Category:" .. language.name .. " terms belonging to the root " .. root_prefix .. root .. "]]")
Line 24: Line 25:
local language = m_languages.get_by_code(args[1])
local language = m_languages.get_by_code(args[1])
local source = m_languages.get_by_code(args[2])
local source = m_languages.get_by_code(args[2])
if args[2] == "*" then source = language end
return export.make_categories(language, source, args[3])
return export.make_categories(language, source, args[3])
end
end


return export
return export