45,647
edits
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
local m_put = require("Module:parse utilities") | local m_put = require("Module:parse utilities") | ||
local | local m_families = require("Module:families") | ||
local gsub = mw.ustring.gsub | local gsub = mw.ustring.gsub | ||
Line 38: | Line 38: | ||
local args = require("Module:parameters").process(frame:getParent().args, params) | local args = require("Module:parameters").process(frame:getParent().args, params) | ||
local fam, lang = | local fam, lang = m_families.getByCode(frame.args[1]), require("Module:languages").getByCode(frame.args[2]) | ||
local proto = | local proto = fam:getProtoLanguage():getCanonicalName() | ||
local links = {}; local categories = {}; local alts = {}; | local links = {}; local categories = {}; local alts = {}; | ||
Line 65: | Line 65: | ||
table.insert(alts, arg) | table.insert(alts, arg) | ||
elseif prefix == "c" then | elseif prefix == "c" then | ||
table.insert(categories, lang:getCanonicalName() .. " terms from " .. proto | table.insert(categories, lang:getCanonicalName() .. " terms from " .. proto .. " *" .. arg) | ||
table.insert(alts, term) | table.insert(alts, term) | ||
end | end | ||
elseif prefix == "a" then | elseif prefix == "a" then | ||
table.insert(links, link(term, arg)) | table.insert(links, link(term, arg)) | ||
table.insert(categories, lang:getCanonicalName() .. " terms from " .. proto | table.insert(categories, lang:getCanonicalName() .. " terms from " .. proto .. " *" .. term) | ||
table.insert(alts, arg) | table.insert(alts, arg) | ||
elseif prefix == "c" then | elseif prefix == "c" then | ||
table.insert(links, link(term)) | table.insert(links, link(term)) | ||
table.insert(categories, lang:getCanonicalName() .. " terms from " .. proto | table.insert(categories, lang:getCanonicalName() .. " terms from " .. proto .. " *" .. arg) | ||
table.insert(alts, term) | table.insert(alts, term) | ||
end | end | ||
Line 80: | Line 80: | ||
else | else | ||
table.insert(links, link(args[a][i])) | table.insert(links, link(args[a][i])) | ||
table.insert(categories, lang:getCanonicalName() .. " terms from " .. proto | table.insert(categories, lang:getCanonicalName() .. " terms from " .. proto .. " *" .. args[a][i]) | ||
table.insert(alts, args[a][i]) | table.insert(alts, args[a][i]) | ||
end | end |