-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
improve docs on loading and applying locales #2683
Conversation
see the contents of this directory for the full list. | ||
They are also available on our CDN as https://cdn.plot.ly/plotly-locale-de-ch-latest.js OR https://cdn.plot.ly/plotly-locale-de-ch-1.38.1.js | ||
Note that the file names are all lowercase, even though the region is uppercase when you apply a locale. | ||
This example uses Swiss-German (de-CH), but many other localizations are available (see the contents of this directory for the full list). All available locales have working date localizations, but only a subset will localize on-graph text (e.g., modebar controls). See [here](https://github.com/plotly/plotly.js/pulls?q=is%3Apr+label%3A%22type%3A+translation%22+is%3Aclosed) for a list of "fully-supported" locales. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps even better, we could ask translation authors to add an entry in a table of "fully" supported localizaion instead of linking to a list of PRs/
|
||
```html | ||
<script src="plotly-locale-de.js"></script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this section is misleading. A priori de-CH
doesn't depend on de
. At the moment, de-CH
fallbacks to de
just because de-CH
isn't "fully" supported.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, I propose we use a "fully" supported language for this example and invite folks we want to use a non-fully supported localization (e.g. de-CH
) to contribute by making a PR.
I notice that module.exports = {
moduleType: 'locale',
name: 'de-CH',
dictionary: {},
format: {
decimal: '.',
thousands: ','
}
}; Something similar can probably be said for all the regional locales currently in the repo... so before we invest more energy in spelling out how to use regional locales we should probably discuss and agree on how we really intend these to be used: do we want the regional locales to always be layered on the base language locale, or should they be independent? We have at least one case right now where you can't layer: we have a contributed Brazilian Portuguese ( |
I'd vote for making all locale dist files (base and regional) standalone, that way users only have to import one file to localize their app. The only drawback I can think is for app that want to display multiple locales. In this case, importing a base locale along with its regional variants will lead to a few duplicated kBs. |
What if we do this in code? ie have module.exports = Lib.extendDeep({}, require('de'), {
name: 'de-CH',
format: {
decimal: '.',
thousands: ','
}
}); Then |
Amazing. 🥇 This doesn't solve the |
That's a (hopefully) uncommon case, where 3/4 of the language's speakers are in a single non-base region (and 20x the number in the base region) - I have no idea how different the two are, but I think it's OK to leave as is for now - hopefully a user from Portugal will come along and make us a |
Moved to #2991 |
No description provided.