Dynamically change language to flipclock.js

I am trying to change the language of the labels on the FlipClock.js watch programmatically when the user selects the language from the dropdown.

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

something like:

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

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

      

but that won't work. i also tried

clock.language = "es"; 

      

and that didn't work either. any ideas?

+3


source to share


2 answers


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

      



+6


source


clock.setOptions('language', 'spanish');

      



+1


source







All Articles