-
Notifications
You must be signed in to change notification settings - Fork 11.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Timeseries xAxis ticks rendered with wrong locale #5664
Comments
Ok so, even changing the locale settings of my laptop to en_US, that labels keep staying in Italian. How and where the engine get the it_IT locale? |
I saw on the source code, in scale.time.js that moment is set as window.moment if not found in the packages. Now the question is: is it possible to add in the time series settings, the chance to add the locale, like it is already possible for the format strings? |
Could you not set the locale by using |
I can, but that's not working. I tried to set it in the app.component.ts, in the specific component when I render the chart, and even just before rendering the chart, but none of them is working |
Hmmm, you may need to import the locale file you need: |
We do not include multiple languages for moment by default because it would make the download size enormous to include all locales by default I have a PR pending that will add support for Luxon and would fix this issue for you: #5522. Luxon uses the built in browser date internationalization APIs and doesn't require to download translation files like moment does |
That's exactly what I needed, using always the built-in browser locale by default. |
Looks like this was resolved with the addition of Luxon via the adapters |
In my Angular 5 web application I'm using a few time series, but the xAxis ticks keep showing in the italian language (as the image shows), even if my system and my browser language is set to english.
(the suffix GD+1, etc are set through a ticks callback, but debugging it, the value is already formatted in the italian language before passing to this callback function.
I cannot understand why, neither how to set the correct locale. I use moment.js extensively in my platform, and the dates I parse and/or format are always in the correct language (which is english), without setting any global property. Also the moment objects that I pass to the chart have the correct english locale.
The text was updated successfully, but these errors were encountered: