I use jqplot, and I have date into my x-axis.
I use the DateAxisRenderer plugin but I want to translate the date to my current locale.
For example, for english
Jan 2012
Feb 2012...
and for french
Jan 2012
Fév 2012...
Any ideas?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A bit of explanation
jqPlot uses jsDate internally: http://sandbox.kendsnyder.com/date2/
jsDate has built-in localization support and locale detection.
This capability, however, is limited to a few ,pre-configured languages, on internal regional table (see 2.).
1. For the lucky ones
Since in my version of jqPlot (v1.0.4) the French language is included in this table (maybe a gift from the authors) all you have to do is simply setting the
langattribute on your<html>tag:Et voilà…
2. Foreigners
If you want to add your own missing language at runtime you can use these instructions:
Do not forget to call
$.jsDate.regional.getLocale()to refresh internal settings and to set the<html>tag accordingly.Mine looks like:
That’s all…
If you aren’t able to control the markup for the
htmltag, you can set it withIt doesn’t work to set
langof an intermediate element, like a surroundingdiv.