MediaWiki:Gadget-sidebartranslate.js

///////////////////////////////////////////////////////////////////////// // Translates the 'in other languages' list in the sidebar to English. // //                                                                    // //           From wikt:User:Bequw/sidebartranslate.js              // /////////////////////////////////////////////////////////////////////////

function languagereplace { var $lang, wgLanguages = mw.config.get('wgLanguages'); // Can be caused by delay in timing if ( wgLanguages === null ) { if ( !document.callbacks_langcode ) { document.callbacks_langcode = new Object; }		document.callbacks_langcode.sidebartranslate = languagereplace; return false; }

$lang = $('#p-lang'); $lang.hide(1).find('ul').find('a').each(function {               var $link = $(this), local;	        if ( wgLanguages[$link.attr('lang')] != null ) {                  local = wgLanguages[$link.attr('lang')].local;                  $link.text(local);                }	}); $lang.show(1); }

$(document).ready( languagereplace );