Changes

Jump to navigation Jump to search

Module:Hatnote

178 bytes removed, 14:10, 4 May 2014
update the makeWikitextError function - don't use Module:Category handler, and use an addTrackingCategory parameter instead of a demo parameter, to make it easy for daughter modules to add a category=no parameter
local mArguments -- lazily initialise [[Module:Arguments]]
local yesno -- lazily initialise [[Module:Yesno]]
local mCategoryHandler -- lazily initialise [[Module:Category handler]]
local p = {}
end
function p.makeWikitextError(msg, demoaddTrackingCategory) -- Formats an error message to be returned to wikitext. If demo -- addTrackingCategory is not nilfalse after being returned from -- or false[[Module:Yesno]], and if we are not on a talk page, no error a tracking category -- is added.
checkType('makeWikitextError', 1, msg, 'string')
yesno = require('Module:Yesno')
mCategoryHandler local title = requiremw.title.getCurrentTitle('Module:Category handler') local errorCategory category if not title.isTalkPage and yesno(addTrackingCategory) ~= false then category = 'Hatnote templates with errors' local errorCategoryLink category = string.format( '[[%s:%s]]', mw.site.namespaces[14].name, category errorCategory ) -- Feed the category link through [[Module:Category handler]] so we can -- use its blacklist. errorCategoryLink = mCategoryHandler.main{else talk category = '', -- Don't categorise talk namespaces. other = errorCategoryLink, nocat = demo } errorCategoryLink = errorCategoryLink or ''end
return string.format(
'<strong class="error">Error: %s.</strong>%s',
msg,
errorCategoryLinkcategory
)
end
Anonymous user

Navigation menu