Module:coinage

Revision as of 01:31, 27 February 2024 by Maria (talk | contribs)

Documentation for this module may be created at Module:coinage/documentation

local export = {}
local params = {
	[1] = {required = true},
	[2] = {},
	["in"] = {},
	["nocap"] = {type = "boolean"},
	["notext"] = {type = "boolean"},
	["nocat"] = {type = "boolean"},
}
function export.show(frame)
	local args = require("Module:parameters").process(frame:getParent().args, params)
	local language = require("Module:languages").get_by_code(args[1])
	local out = ""
	if not args["notext"] then
		out = out .. "[[Appendix:Glossary#coinage|" .. (args["nocap"] and "c" or "C") .. "oined]]" .. (args[2] and " in " or "")
	end
	if args[2] then out = out .. args[2] end
	if args["in"] then out = " in " .. args["in"] end
	if not args["nocat"] then out = out .. "[[Category:" .. language.name .. " coinages]]" end
	return out
end
return export