User:Lenni009/common.js

$(function {   var config = mw.config.get([ 'wgPageContentLanguage', 'wgUserLanguage' ]);   if ( window.ViewInContentLangLoaded || config.wgPageContentLanguage === config.wgUserLanguage ) {       return;    }    window.ViewInContentLangLoaded = true;    importArticle({ type: 'script', article: 'u:dev:MediaWiki:I18n-js/code.js' });   var place = '.wds-global-navigation__user-menu .wds-list, .wiki-tools .wds-dropdown__content .wds-list';    mw.hook('dev.i18n').add(function(i18no) { i18no.loadMessages('ViewInContentLang').then(function(i18n) {           $( ($(place).length === 0) ? '.toolbar ul.tools' : place ).append( $('', {                   id: 'ca-language'                }).append(                    $('', { href: new mw.Uri.extend({                           uselang: config.wgPageContentLanguage                        }).toString, text: i18n.msg('text').plain, title: i18n.msg('title').plain })               )            );        });    }); });