User:Guiwatami/global.js

$(function {   var config = mw.config.get(['wgUserLanguage', 'wgContentLanguage']),        newlang = config.wgContentLanguage == 'pt' ? 'pt-br' : config.wgContentLanguage;    if (config.wgUserLanguage != newlang) {        var a = new mw.Api;        return a.postWithToken('csrf', { action: 'options', change: 'language='+newlang }).then(function { location.reload; });   } });