2,788
edits
No edit summary |
No edit summary |
||
Line 3: | Line 3: | ||
[1] = {required = true}, | [1] = {required = true}, | ||
[2] = {}, | [2] = {}, | ||
[3] = {}, | |||
["alt"] = {alias_of = 3}, | |||
["in"] = {}, | ["in"] = {}, | ||
["nationality"] = {}, | |||
["n"] = {alias_of = "nationality"}, | |||
["nat"] = {alias_of = "nationality"}, | |||
["occupation"] = {}, | |||
["o"] = {alias_of = "occupation"}, | |||
["occ"] = {alias_of = "occupation"}, | |||
["at"] = {}, | |||
["nocap"] = {type = "boolean"}, | ["nocap"] = {type = "boolean"}, | ||
["notext"] = {type = "boolean"}, | ["notext"] = {type = "boolean"}, | ||
["nocat"] = {type = "boolean"}, | ["nocat"] = {type = "boolean"}, | ||
} | } | ||
local function format_coinage(name, alt_name, coined_in, coiner_nat, coiner_occ, coined_at) | |||
local out = name or alt_name or "" | |||
if coined_in then out = out .. (#out > 0 and " " or "") .. "in " .. coined_in end | |||
if coiner_occ then out = coiner_occ .. (#out > 0 and (" " .. out) or "") end | |||
if coiner_nat then out = coiner_nat .. (#out > 0 and (" " .. out) or "") end | |||
if coined_at then out = out .. (#out > 0 and " " or "") .. "at " .. coined_at end | |||
return out | |||
end | |||
function export.show(frame) | function export.show(frame) | ||
local args = require("Module:parameters").process(frame:getParent().args, params) | local args = require("Module:parameters").process(frame:getParent().args, params) | ||
local language = require("Module:languages").get_by_code(args[1]) | local language = require("Module:languages").get_by_code(args[1]) | ||
local out = "" | local out = format_coinage(args[2], args[3], args["in"], args["nationality"], args["occupation"], args["at"]) | ||
if not args["notext"] then | if not args["notext"] then | ||
out = | out = "[[Appendix:Glossary#coinage|" .. (args["nocap"] and "c" or "C") .. "oined]]" .. (#out > 0 and " by " or "") .. out | ||
end | |||
if not args["nocat"] then | |||
out = out .. "[[Category:" .. language.name .. " coinages]]" | |||
if args[2] and #args[2] > 0 then | |||
out = out .. "[[Category:" .. language.name .. " terms coined by " .. args[2] .. "]]" | |||
end | |||
end | end | ||
return out | return out | ||
end | end | ||
return export | return export |