Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

dynamically change language on flipclock.js

i'm trying to change the language of the labels on a FlipClock.js clock programatically, when the user selects a language from a dropdown.

i see how to set the language when instantiating the clock (https://github.com/objectivehtml/FlipClock/blob/master/examples/localization.html) and i see the docs here http://flipclockjs.com/api but I'm not sure how to dynamically change the language.

something like:

var clock = $('#flipclock').FlipClock(6000, {
    countdown: true,
    clockFace: 'DailyCounter'
});

clock.loadLanguage("es"); // change language? doesn't work

but that doesn't work. i also tried

clock.language = "es"; 

and that didn't work either. any ideas?

like image 364
split19 Avatar asked Dec 25 '22 05:12

split19


1 Answers

var clock = $('#flipclock').FlipClock(6000, {
    countdown: true,
    clockFace: 'DailyCounter',
    language:'es-es',
});
like image 76
alebupal Avatar answered Jan 15 '23 17:01

alebupal