Module:Int: Difference between revisions
From Test Wiki
Content deleted Content added
m>MusikBot II m Changed protection settings for "Module:Int": High-risk template or module (more info) ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)) |
check message in the target language, not the default, still return missing message markup if message does not exist (and is not just disabled) |
||
| Line 1: | Line 1: | ||
-- This is a helper module for Template:int |
-- This is a helper module for [[Template:int]] |
||
| ⚫ | |||
local this = {} |
local this = {} |
||
| ⚫ | |||
function this.renderIntMessage(frame) |
function this.renderIntMessage(frame) |
||
local args = frame.args |
|||
local pargs = (frame:getParent() or {}).args |
|||
local arguments = {} |
|||
for k, v in pairs(pargs) do |
|||
local n = tonumber(k) or 0 |
|||
if (n >= 2) then |
|||
arguments[n - 1] = mw.text.trim(v) |
|||
end |
|||
end |
|||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
if msg:exists() or lang == 'qqx' then |
|||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
return args.missing or '' |
|||
else |
|||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
else |
|||
return args.missing ~= '' |
|||
and args.missing |
|||
| ⚫ | |||
end |
|||
end |
end |
||