[Koha] 'Translating' images

Stefano Bargioni bargioni at pusc.it
Thu Mar 31 05:20:58 NZDT 2011


In some cases, images need to be changed depending on the language.
An example: the cart has a cart icon, of course, but the Italian translation uses 'scaffale', and the Spanish translation uses 'bolsa', that are not carts. So the icon needs to be 'translated' accordingly.

Here is a proposal to do this (case it-IT). Add an icon named scaffale.png into the opac-tmpl/prog/images directory and the following code to the opacuserjs syspref:

$(document).ready(function() {
 var lang = readCookie('KohaOpacLanguage');
 if (lang=='it-IT') {
  $('#cartmenulink img').attr('src','/opac-tmpl/prog/images/scaffale.png');
  $('a.addtocart').css('background-image','url(/opac-tmpl/prog/images/scaffale.png)');
 }
});

Cart icons will be changed on page load.
Bye. Stefano


More information about the Koha mailing list