More languages
More actions
No edit summary |
reverted to july 2023 version Tag: Manual revert |
||
| Line 1: | Line 1: | ||
local p = {} | local p = {} | ||
function p.getWorkCount(frame) | function p.getWorkCount(frame) | ||
local category = frame.args.category or '' | local category = frame.args.category or '' | ||
local pages = mw.site.stats.pagesInCategory(category) | |||
local pages = | |||
if tonumber(pages) == 1 then | if tonumber(pages) == 1 then | ||
return "1 work" | |||
else | else | ||
return pages .. " works" | |||
end | end | ||
end | end | ||
Revision as of 15:19, 14 September 2024
local p = {}
function p.getWorkCount(frame)
local category = frame.args.category or ''
local pages = mw.site.stats.pagesInCategory(category)
if tonumber(pages) == 1 then
return "1 work"
else
return pages .. " works"
end
end
function p.main(frame)
return p.getWorkCount(frame)
end
return p