MediaWiki:Gadget-MyLangNotify.js

From Wikipedia

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

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
/*global jQuery:false, mw: false*/
jQuery(document).ready(function() {
'use strict';
	
	var wgUserLanguage = mw.config.get('wgUserLanguage');

	if ((mw.config.get('wgNamespaceNumber') !== 6) || (mw.config.get('wgAction') !== 'view')) {
		return;
	}

	var mylangnotify_message = {
		'en': 'This image does not appear to have a description in your interface language. Please add one!',
		'ca': 'Aquesta imatge sembla que no té una descripció en català. Podeu afegir-la!',
		'cs': 'Tento obrázek nemá popis v jazyce vašeho rozhraní. Prosím, přidejte jej!',
		'de': 'Dieses Bild hat anscheinend noch keine Beschreibung in Deutsch! Füge eine mit {{de|Beschreibung}} hinzu!',
		'eo': 'Al ĉi tiu bildo ŝajne mankas priskribo en Esperanto. Bonvolu aldoni {{eo|priskribon}}.  ',
		'es': 'Esta imagen no tiene la descripción en español. ¡AÑÁDELA DE UNA VEZ!',
		'fi': 'Tällä tiedostolla ei ole vielä suomenkielistä kuvausta.',
		'fr': 'Cette image ne semble pas avoir de description en français... Ajoutez une {{fr|description}} !',
		'ml': 'ഈ ചിത്രത്തിന്റെ വിവരണം, താങ്കൾ ഉപയോഗിക്കുന്ന സമ്പർക്കമുഖ ഭാഷയിൽ ലഭ്യമല്ല എന്നനുഭവപ്പെടുന്നു. ദയവായി ചേർക്കുമല്ലോ!',
		'nds': 'Disse Datei is noch nich op Plattdüütsch beschreven. Du kannst aver mit {{nds|Beschrieven}} en Text tofögen!',
		'nl': 'Deze afbeelding heeft nog geen beschrijving in de Nederlandse taal. Voeg die alstublieft toe!'
	};

	var $mylangdesc = jQuery('div.description.' + wgUserLanguage);

	if ($mylangdesc.length) {
		$mylangdesc.css('fontSize', '14pt');
	} else {
		jQuery('#firstHeading').after('<div style="color:red;">' + (mylangnotify_message[wgUserLanguage] || mylangnotify_message.en) +'</div>');
	}
});