richardscarrott / jquery-ui-carousel

jQuery RS Carousel is a responsive and touch-enabled carousel written on top of jQuery and the jQuery UI Widget Factory providing a full and familiar API in less than 2.6kB minified and gzipped.
http://richardscarrott.github.io/jquery-ui-carousel/
192 stars 56 forks source link

[enhancement] translation #57

Closed quasiperfect closed 11 years ago

quasiperfect commented 11 years ago

thanks for your work can you please add the ability to translate the strings ?

richardscarrott commented 11 years ago

This can already be done by using the insertNextAction and insertPrevAction options:

$('.rs-carousel').carousel({
        insertPrevAction: function () {
            return $('<a href="#" class="rs-carousel-action rs-carousel-action-prev">Précédent</a>').appendTo(this);
        },
        insertNextAction: function () {
            return $('<a href="#" class="rs-carousel-action rs-carousel-action-next">Suivant</a>').appendTo(this);
        }
});

If you'd like to do it globally you can modify the prototype like this:

$.extend($.rs.carousel.prototype.options, {
    insertNextAction: function () {},
    insertPrevAction: function () {}
});

I had thought about making separate options just for the text but felt it over-complicated the API.

quasiperfect commented 11 years ago

ty @richardscarrott method 2 is enough