Zum Inhalt springen

Modul:Protection banner: Unterschied zwischen den Versionen

make the variable names a little more descriptive
(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)
(make the variable names a little more descriptive)
Zeile 809: Zeile 809:
)
)
if not protectionObjCreated then
if not protectionObjCreated then
local msg = protectionObj -- protectionObj is the error message.
local errorMessage = protectionObj
local boilerplate = cfg.msg['error-message-blurb'] or 'Error: $1.'
local errorBlurb = cfg.msg['error-message-blurb'] or 'Error: $1.'
local errorText = mw.message.newRawMessage(boilerplate):params(msg):plain()
local errorText = mw.message.newRawMessage(errorBlurb):params(errorMessage):plain()
return string.format(
return string.format(
'<strong class="error">%s</strong>',
'<strong class="error">%s</strong>',
Anonymer Benutzer