Anonymous user
Module:Protection banner: Difference between revisions
use cfg.explanationBlurbs to fetch the explanation blurbs rather than hard-coding the message keys here
(add explanation blurb for semi-protection) |
(use cfg.explanationBlurbs to fetch the explanation blurbs rather than hard-coding the message keys here) |
||
Line 469:
function Blurb:_makeExplanationBlurbParameter()
-- Cover special cases first.
if self._protectionObj.title.namespace == 8 then▼
-- MediaWiki namespace▼
local action = self._protectionObj.action
local level = self._protectionObj.level
local
-- Find the message in the explanation blurb table and substitute any
-- parameters.
local key▼
local explanations = self._cfg.explanationBlurbs
▲ if namespace == 8 then
▲ -- MediaWiki namespace
if explanations[action][level] and explanations[action][level][talkKey] then
▲ key = 'explanation-blurb-full-nounprotect'
msg = explanations[action][level][talkKey]
elseif explanations[action][level] and explanations[action][level].default then
msg = explanations[action][level].default
elseif explanations[action].default and explanations[action].default[talkKey] then
msg = explanations[action].default[talkKey]
elseif explanations[action].default and explanations[action].default.default then
msg = explanations[action].default.default
▲ end
else
error(string.format(
▲ key = 'explanation-blurb-default'
'could not find explanation blurb for action "%s", level "%s" and talk key "%s"',
action,
level,
talkKey
))
end
return self:
end
|