Module:Sprite: Difference between revisions
Cascading protection was implemented in 1.24... |
Only remove categories from translation pages, instead of all subpages |
||
| Line 122: | Line 122: | ||
if f == mw.getCurrentFrame() then | if f == mw.getCurrentFrame() then | ||
args = require( 'Module:ProcessArgs' ).merge( true ) | args = require( 'Module:ProcessArgs' ).merge( true ) | ||
else | |||
f = mw.getCurrentFrame() | |||
end | end | ||
| Line 140: | Line 142: | ||
local title = mw.title.getCurrentTitle() | local title = mw.title.getCurrentTitle() | ||
-- Remove categories on | -- Remove categories on language pages, talk pages, and in User/UserWiki/UserProfile namespaces | ||
local disallowCats = title. | local disallowCats = title.isTalkPage or title.nsText:find( '^User' ) | ||
if idData then | if idData then | ||
if type( idData ) == 'table' then | if type( idData ) == 'table' then | ||
if idData.deprecated and not disallowCats then | if idData.deprecated and not disallowCats then | ||
table.insert( categories, ' | table.insert( categories, f:expandTemplate{ title = 'Translation category', args = { 'Pages using deprecated sprite names', project = 0 } } ) | ||
end | end | ||
| Line 153: | Line 155: | ||
end | end | ||
elseif not disallowCats then | elseif not disallowCats then | ||
table.insert( categories, ' | table.insert( categories, f:expandTemplate{ title = 'Translation category', args = { 'Pages with missing sprites', project = 0 } } ) | ||
end | end | ||