Modul:Plural
Aspect

local p = {}
plural = {}
plural["locuitor"] = "locuitori"
function get_first_plural(singular)
if plural[singular] ~= nil then
return plural[singular]
else
return string.format("%si", singular)
end
end
function p.get_plural(frame)
mw.log(frame.args[1])
mw.log(frame.args[2])
count = tonumber(frame.args[1])
singular = frame.args[2]
if count == 1 then
return string.format("%d %s", count, singular)
elseif count == 0 or (count%100 > 0 and count%100 < 20) then
first_plural = get_first_plural(singular)
return string.format("%d %s", count, first_plural)
else
first_plural = get_first_plural(singular)
return string.format("%d de %s", count, first_plural)
end
end
return p