MediaWiki:LangSwitch.js

/** * @Name           LangSwitch * @Version        v1.0 * @Author(s)      TheGoldenPatrik1 * @Description    Adds a button to quickly switch languages. */

(function {   if (window.LangSwitchLoaded) {        return;    }    window.LangSwitchLoaded = true;    importArticle({ type: 'script', article: 'u:dev:MediaWiki:I18n-js/code.js' });   mw.hook('dev.i18n').add(function(i18no) { i18no.loadMessages('LangSwitch').then(function(i18n) {           $('#my-tools-menu').prepend( $('').append(                   $('', { id: 'lang', text: i18n.msg('text').plain })               )            )                .click(function { var href = prompt(i18n.msg('prompt').plain, window.LangSwitchDefault || 'qqx'); if (href) { window.location.href = new mw.Uri.extend({                           uselang: href                        }).toString; }               });            });        });    }) ;