User:Pcj/CheckDefaultLoadoutTranslations.js

var otherWikis = ["default-loadout-ptbr.gamepedia.com","default-loadout-it.gamepedia.com","default-loadout-ru.gamepedia.com","default-loadout-zh.gamepedia.com","default-loadout-pl.gamepedia.com","default-loadout-de.gamepedia.com","default-loadout-es.gamepedia.com","default-loadout-fr.gamepedia.com","default-loadout-pt.gamepedia.com"] a = new mw.Api; var templates = []; cw = 0; var owTemplates = []; function gNW { if (cw == otherWikis.length) { console.log("Done."); return; }	owTemplates = []; fa = new mw.ForeignApi("https://"+otherWikis[cw]+"/api.php"); fa.get({action:"query",list:"allpages",aplimit:500,apnamespace:10,meta:"siteinfo",siprop:"namespaces"}).done(function(data) {		tnsalias = data.query.namespaces["10"]["*"];		for (p in data.query.allpages) owTemplates.push(data.query.allpages[p].title.replace(tnsalias+":",""));		for (t in templates) {			if (owTemplates.indexOf(templates[t])==-1 && templates[t].indexOf("/doc") == -1) console.log("https://"+otherWikis[cw]+" needs https://default-loadout-en.gamepedia.com/Template:"+templates[t].replace(/ /g,"_"));		}		cw++;		gNW;	}).fail(function(data) {		console.log("Could not get data for wiki "+otherWikis[cw]);		cw++;		gNW;	}); } a.get({action:"query",list:"allpages",aplimit:500,apnamespace:10}).done(function(data) {	for (p in data.query.allpages) templates.push(data.query.allpages[p].title.replace("Template:",""));	gNW; });