Skip to content
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

Internationalization #43

Closed
benmccann opened this issue Nov 2, 2019 · 4 comments
Closed

Internationalization #43

benmccann opened this issue Nov 2, 2019 · 4 comments

Comments

@benmccann
Copy link
Contributor

You can use the Intl API to format times so that they render in other language-agnostic format. E.g. I work on a site that supports both English and Spanish and "October" would automatically show up as "Octubre" in my charts on that site because they're using Luxon which uses the browser's Intl api under the covers. You don't need to provide any translations as the browser has them built in. You could either use a library like Luxon or use the Intl API directly

@leeoniya
Copy link
Owner

leeoniya commented Nov 2, 2019

3f2vzv

@leeoniya
Copy link
Owner

leeoniya commented Nov 2, 2019

i've been hoping to side-step these concerns by exposing full control over the axis and legend value gen. uPlot ships with and exposes a fast English formatter [1], and exposes axis.values and series.value that provide the full story for all date formatting concerns. it's easy to override all of these and use Luxon or whatever to fully customize the displayed values. i'm afraid of bloating the lib and creating undue maintenance burden by providing more than the core functions that are necessary for customization by the user.

i've always known that whatever label format i chose to ship as the default would only please 20% of uPlot's audience. even if i were to use the intl API directly, i don't see how it would be possible to avoid the snowball effect of offering and supporting a lot more.

[1] https://github.com/leeoniya/uPlot/blob/master/src/fmtDate.js

@benmccann
Copy link
Contributor Author

Yeah, I agree users will want ability to change formats. Intl api might provide a nice default, but even still I agree that there will be many requests to override and change the formatting.

@leeoniya
Copy link
Owner

leeoniya commented Nov 2, 2019

this is likely out of scope for a micro lib. as long as enough nuts and bolts are there to add support externally.

thanks for bringing it up tho!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants