User:Stefan04/global.js

if (wgUserLanguage != wgPageContentLanguage) {

/*

mw.loader.using('mediawiki.api', function {    var api = new mw.Api;    api.get({ action: 'tokens', type: 'options' }).done(function (json) { api.post({       action: 'options',        change: 'wplanguage='.concat(wgPageContentLanguage),        token: json.tokens.optionstoken      }); }); });  */

url = location.href.split("#", 1); if (url[0].indexOf('\?') == -1) url[0]=url[0]+'?uselang=' + wgPageContentLanguage; else url[0]=url[0]+'&uselang=' + wgPageContentLanguage; if (location.href.indexOf('action=submit') =! -1) location.href = url[0] + url[1]; }