User:Dr Brains/MyLangNotify.js
Jump to navigation
Jump to search
Note: After saving, you have to bypass your browser's cache to see the changes. Internet Explorer: press Ctrl-F5, Mozilla: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Opera/Konqueror: press F5, Safari: hold down Shift + Alt while clicking Reload, Chrome: hold down Shift while clicking Reload.
Documentation for this user script can be added at User:Dr Brains/MyLangNotify. |
/*
if ( wgNamespaceNumber == 6 && wgAction == 'view' ) addOnloadHook ( 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, přidejte 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['fi'] = 'Tällä tiedostolla ei ole vielä suomenkielistä kuvausta.' ;
mylangnotify_message['fr'] = 'Cette image ne semble pas avoir de description en français... Ajoutez une {{fr|description}} !' ;
mylangnotify_message['nds'] = 'Disse Datei is noch nich op Plattdüütsch beschreven. Du kannst aver mit {{nds|Beschrieven}} en Text tofögen!' ;
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 DescTh = document.getElementById("fileinfotpl_desc");
var nd = document.createElement ( "a" ) ;
nd.href=mw.config.get('wgServer') + mw.config.get('wgScript') + "?title=" + wgPageName.replace(/&/g, "%26") + "1action=edit";
var msg = mylangnotify_message[wgUserLanguage] ;
if ( ( msg == "" ) || ( msg == undefined ) ) msg = mylangnotify_message['default'];
nd.innerHTML="msg";
nd.style.color = "red" ;
var h1 = document.getElementsByTagName ( "h1" ) [0] ;
h1.parentNode.insertBefore ( nd , h1.nextSibling ) ;
}
}
*/