MediaWiki:Gadget-topLangLinks.js: Difference between revisions
Created page with "→MediaWiki:Gadget-topLangLinks.js: →https://structorica.wiki/w/MediaWiki:Gadget-topLangLinks.js: : →Based on: https://minecraft.wiki/w/MediaWiki:Gadget-topLangLinks.js: mw.loader .using([ "mcw.messages", // 'mediawiki.api', "mediawiki.language", "mediawiki.jqueryMsg", "oojs-ui-widgets", "oojs-ui.styles.icons-editing-advanced", ]) /*.then( function() { // Load the system messages needed for the UI using `mediawiki.api`. // Thi..." |
No edit summary |
||
| Line 5: | Line 5: | ||
mw.loader | mw.loader | ||
.using([ | .using([ | ||
// Removed 'mcw.messages' dependency as it's Minecraft Wiki specific | |||
// 'mediawiki.api', | // 'mediawiki.api', | ||
"mediawiki.language", | "mediawiki.language", | ||
| Line 15: | Line 15: | ||
// This is expensive for the server since this gadget is run on every visit. | // This is expensive for the server since this gadget is run on every visit. | ||
// To save bandwidth, we're using `mcw.messages` to pre-load them instead. | // To save bandwidth, we're using `mcw.messages` to pre-load them instead. | ||
// Alternatively, the messages can be hardcoded here before loading. | // Alternatively, the messages can be hardcoded here before loading. | ||
// Here's what that looks like for English: | // Here's what that looks like for English: | ||
| Line 33: | Line 33: | ||
} )*/ | } )*/ | ||
.then(function () { | .then(function () { | ||
// Forked from Minecraft Wiki: hardcoded messages for Structorica Wiki | |||
// Uncomment below for English localization instead: | |||
mw.messages.set( | |||
"vector-language-button-label", | |||
"{{PLURAL:$1|$1 language|$1 languages}}" | |||
); | |||
mw.messages.set("otherlanguages", "In other languages"); | |||
mw.messages.set("pipe-separator", " | "); | |||
// Russian localization for the language selector gadget | |||
/* | |||
mw.messages.set( | |||
"vector-language-button-label", | |||
"{{PLURAL:$1|$1 язык|$1 языка|$1 языков}}" | |||
); | |||
mw.messages.set("otherlanguages", "На других языках"); | |||
mw.messages.set("pipe-separator", " | "); | |||
*/ | |||
var links = $("#p-lang .interlanguage-link a.interlanguage-link-target"); | var links = $("#p-lang .interlanguage-link a.interlanguage-link-target"); | ||
if (!links.length) return; | if (!links.length) return; | ||