Module:Etraud/Sandbox1
Documentation for this module may be created at Module:Etraud/Sandbox1/doc
local p = {}
local function addCategory(frame, pronoun)
local category = "Category:Players who use " .. pronoun .. ""
return frame:preprocess("[[" .. category .. "]]")
end
function p.pronoun(frame)
local args = frame.args
local pronouns = {
he = "he",
she = "she",
they = "they"
}
local selectedPronouns = {}
for i, arg in ipairs(args) do
if pronouns[arg] then
table.insert(selectedPronouns, pronouns[arg])
addCategory(frame, pronouns[arg])
end
end
if #selectedPronouns == 0 then
return "No valid pronouns specified."
else
return table.concat(selectedPronouns, "/")
end
end
return p