Content deleted Content added
wrong submodule name |
rank all sister projects |
||
Line 1:
local function trimArg(arg, i)
arg = mw.text.trim(arg or '')
Line 82 ⟶ 79:
local function rank(frame)
--
local args = frame:getParent().args
local parm = trimArg(args[1], 1) -- a number like 12 or a site name like "af"
local base = trimArg(args[2]) or 'wikipedia' -- base of full site name like "wikipedia" or "wikiquote"
local data = mw.loadData('Module:NUMBEROF/rank')▼
local wantComma = trimArg(args[3])
local result▼
▲ local data = mw.loadData('Module:NUMBEROF/' .. (base == 'wikipedia' and 'rank' or 'other'))
parm = tonumber(parm) or parm▼
data = data[base]
if type(parm) == 'number' then▼
result = data.rankByIndex[parm]▼
▲ result = data.rankByIndex[parm]
result = data.rankBySite[parm]▼
if result and wantComma then
result = mw.getContentLanguage():formatNum(result)
end▼
if result then
end
▲ else
▲ end
▲ result = data.rankBySite[parm]
▲ end
▲ if result then
end
return -1
|