More actions
Content deleted Content added
make the args table optional from p._main |
localise the error message by moving the makeWikitextError function code inside p._main; that way we don't have to worry about making cfg global |
||
Line 15: | Line 15: | ||
-- Helper functions |
-- Helper functions |
||
-------------------------------------------------------------------------------- |
-------------------------------------------------------------------------------- |
||
local function makeWikitextError(msg) |
|||
-- @TODO: localise this. |
|||
local boilerplate = 'Error: $1 ([[Module:Protection banner#Errors|help]])' |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
) |
|||
end |
|||
local function makeCategoryLink(cat) |
local function makeCategoryLink(cat) |
||
Line 819: | Line 809: | ||
) |
) |
||
if not protectionObjCreated then |
if not protectionObjCreated then |
||
-- protectionObj is the error message. |
local msg = protectionObj -- protectionObj is the error message. |
||
local boilerplate = cfg.msg['error-message-blurb'] or 'Error: $1.' |
|||
return makeWikitextError(protectionObj) |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
) |
|||
end |
end |
||