VOOZH about

URL: https://minecraft.wiki/w/MediaWiki:Gadget-allLangs.js

⇱ MediaWiki:Gadget-allLangs.js – Minecraft Wiki


MediaWiki:Gadget-allLangs.js

From Minecraft Wiki
Jump to navigation Jump to search
In other languages

Note: After saving, you have to bypass your browser's cache to see the changes.

Google Chrome, Firefox, Microsoft Edge, and Safari: Hold down the key and click the Reload toolbar button.
For details and instructions about other browsers, see Wikipedia:Bypass your cache.

mw.loader.using([
'mediawiki.util',
'mcw.messages',
'ext.gadget.global-utils'
]).then(()=>{
constwikiList=require('ext.gadget.global-utils').wikiList;
constconfig=mw.config.get([
'wgNamespaceNumber',
'wgCanonicalNamespace',
'wgCanonicalSpecialPageName',
'wgTitle',
'wgServer'
]);
letpagename='';
if([8,9].includes(config.wgNamespaceNumber)){// MediaWiki, Talk
pagename=config.wgCanonicalNamespace+':'+config.wgTitle;
}elseif(config.wgNamespaceNumber===-1){// Special
pagename=config.wgCanonicalNamespace+':'+config.wgCanonicalSpecialPageName;
constsubpageIdx=config.wgTitle.indexOf('/');
if(subpageIdx>=0)
pagename=pagename+config.wgTitle.substring(subpageIdx);
}
if(!pagename.length||$('#p-lang').length)return;
constpagepath=mw.util.getUrl(pagename);
constwikis=wikiList.filter(wiki=>wiki.url!==config.wgServer);
constportlet=mw.util.addPortlet('p-lang',mw.msg('otherlanguages'),'#p-tb');
for(constwikiofwikis){
constwikiName=wiki.name[0].toUpperCase()+wiki.name.slice(1);
constlink=mw.util.addPortletLink('p-lang',wiki.url+pagepath,wikiName);
$(link).addClass('interlanguage-link interwiki-'+wiki.id)
.find('a').addClass('interlanguage-link-target').attr({
'title':pagename+' – '+wiki.name,
'lang':wiki.id,
'hreflang':wiki.id,
'data-title':pagename,
'data-language-autonym':wikiName,
'data-language-local-name':wiki.name
});
}
mw.hook('mcw.makeSidebarPortletCollapsible').fire(portlet);
});
Retrieved from "https://minecraft.wiki/w/MediaWiki:Gadget-allLangs.js?oldid=3458773"

Navigation menu