MediaWiki:Gadget-MyLangNotify.js
Not: Sayfayı kaydettikten sonra değişiklikleri görebilmek için tarayıcınızın önbelleğinizi temizlemeniz gerekir. Google Chrome, Firefox, Microsoft Edge ve Safari: ⇧ Shift tuşuna basılı tutun ve Yeniden Yükle araç çubuğu düğmesine tıklayın. Ayrıntılar ve diğer tarayıcılara yönelik yönergeler için Vikipedi:Önbelleğinizi atlayın sayfasını inceleyin.
if ( mw.config.get('wgNamespaceNumber') == 6 ) $( mylangnotify ) ;
var mylangnotify_done = 0 ;
var mylangnotify_message = Array ;
mylangnotify_message['en'] = 'This image does not appear to have a description in your interface language. Please add one!' ;
mylangnotify_message['cs'] = 'Tento obrázek nemá popis v jazyce vašeho rozhraní. Prosím, pridejte jej...' ;
mylangnotify_message['de'] = 'Dieses Bild hat anscheinend noch keine Beschreibung in Deutsch! Füge eine mit {{de|Beschreibung}} hinzu!' ;
mylangnotify_message['eo'] = 'Al ĉi tiu bildo ŝajne mankas priskribo en Esperanto. Bonvolu aldoni {{eo|priskribon}}. ' ;
mylangnotify_message['es'] = 'Esta imagen no tiene la descripción en español. ¡AÑÁDELA DE UNA VEZ!' ;
mylangnotify_message['fr'] = 'Cette image ne semble pas avoir de description en français... Ajoutez une {{fr|description}} !' ;
mylangnotify_message['nl'] = 'Deze afbeelding heeft nog geen beschrijving in de Nederlandse taal. Voeg die alstublieft toe!' ;
mylangnotify_message['default'] = 'THIS IMAGE DOES NOT APPEAR TO HAVE A DESCRIPTION IN YOUR OWN LANGUAGE! PLEASE ADD ONE...' ;
function mylangnotify () {
if ( mylangnotify_done ) return ;
mylangnotify_done = 1 ;
var className = "description " + wgUserLanguage ;
var mylangdesc = getElementsByClassName ( document , "div" , className ) ;
if ( mylangdesc && mylangdesc.length > 0 ) {
for ( var m = 0 ; m < mylangdesc.length ; m++ )
mylangdesc[m].style.fontSize = "14pt" ;
} else {
var h1 = document.getElementsByTagName ( "h1" ) [0] ;
var nd = document.createElement ( "div" ) ;
var msg = mylangnotify_message[wgUserLanguage] ;
if ( ( msg == "" ) || ( msg == undefined ) ) msg = mylangnotify_message['default'];
nd.appendChild ( document.createTextNode ( msg ));
nd.style.color = "red" ;
h1.parentNode.insertBefore ( nd , h1.nextSibling ) ;
}
}