MediaWiki:Van-RedirectCategories.js

/** * Auto-redirect to local version of Noindexedpages tracking category * * This is a Vanguard tool */   const conf = mw.config.get( [        'wgNamespaceNumber',        'wgTitle',        'wgContentLanguage',        'wgFormattedNamespaces'    ] ); if (       conf.wgContentLanguage !== 'en' &&        ( conf.wgNamespaceNumber === 14 && /Noindexed pages(\):)?$/.test( conf.wgTitle )       ) ) {       mw.loader.using( [ 'mediawiki.api', 'mediawiki.util' ], function { if ( mw.util.getParamValue( 'redirect' ) === 'no' ) return;
 * ( function {

new mw.Api.get( {               action: 'query',                formatversion: 2,                meta: 'allmessages',                ammessages: 'noindex-category',                amlang: conf.wgContentLanguage            } ).done( function( resp ) {                location.replace( mw.util.getUrl( conf.wgFormattedNamespaces[14] + ':' + resp.query.allmessages[0].content ) );           } );        } );    } } );