Module:Gender and number/templates

< Module:Gender and number
Revision as of 22:45, 27 November 2023 by wiktionary>Benwing2 (clean up, allow etym languages)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Documentation for this module may be created at Module:Gender and number/templates/doc

local export = {}

function export.format_one(frame)
	local parent_args = frame:getParent().args
	local params = {
		[1] = {required = true},
		["lang"] = {},
		["pos"] = {},
	}
	-- FIXME!!! This is called from [[Template:g-lite/node]] with extraneous parameters.
	local args = require("Module:parameters").process(parent_args, params, "return unknown")
	local lang = args.lang and require("Module:languages").getByCode(args.lang, "lang", "allow etym")
	local html, cats = require("Module:gender and number").format_genders({{ spec = args[1] }}, lang, args.pos)
	return html .. require("Module:utilities").format_categories(cats, lang)
end

return export