timer.jquery
timer.jquery copied to clipboard
Changing the language of the timer
Currently the timer is showing the time in englisch e.g. 25 sec. How can I change this to another language?
That s a very good question! However currently the plugin just shows up in English. Some fundamental changes will have to be made for this feature. It will require some localization too.
Please feel free to add this feature.. PRs are welcome :)
You can use the format option to customize. See https://github.com/walmik/timer.jquery#format-syntax.
Example:
$("#div-id").timer({
seconds: 10,
format: '%s segundos' // 'seconds' in spanish
});
I had forgotten about the format syntax! Damn neat @shantanuthatte
If you are using some i18n library you can theoretically do:
$("#div-id").timer({
seconds: 10,
format: '%s ' + i18n.get('seconds', user.lang) // Or however you use i18n
});
Perfect - Thank you for your helpful hints!