Ambox notice.png
Scheduled Maintenance
The wiki will be going down for routine maintenance on Friday, October 4th, 2024, at approximately 3:30 PM Central Time (15:30) or 1:30 PM Pacific Time. The site may be inaccessible during this time and the database will be locked from editing. We expect the maintenance to take about thirty minutes. We strongly encourage joining our Discord for updates.

Module:Gender and number/templates

< Module:Gender and number
Revision as of 02:05, 10 June 2024 by Maltropia (talk | contribs) (1 revision imported)
(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