You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: dist/README.md
+15-8Lines changed: 15 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -36,25 +36,32 @@ You can grab the relevant MathJax files in `./dist/extras/mathjax/`.
36
36
### To include localization
37
37
38
38
Plotly.js defaults to US English (en-US) and includes British English (en) in the standard bundle.
39
-
Many other localizations are available - here is an example using Swiss-German (de-CH),
40
-
see the contents of this directory for the full list.
41
-
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
42
-
Note that the file names are all lowercase, even though the region is uppercase when you apply a locale.
39
+
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.
43
40
44
-
*After* the plotly.js script tag, add:
41
+
#### Loading and registering locales
42
+
43
+
Some locales build on other locales (e.g., "de-CH" builds on "de"). In this case, first load the base locale (e.g., "de"), then load the actual locale (e.g., "de-CH"):
45
44
46
45
```html
46
+
<scriptsrc="plotly-locale-de.js"></script>
47
47
<scriptsrc="plotly-locale-de-ch.js"></script>
48
+
```
49
+
50
+
Locale bundles are also available on our CDN (e.g., 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 here are all lowercase, but the region is uppercase when you apply a locale.
51
+
52
+
#### Apply a locale
53
+
54
+
After registering a locale, you can it as the default for all Plotly plots:
Copy file name to clipboardExpand all lines: tasks/stats.js
+16-9Lines changed: 16 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -70,25 +70,32 @@ function getInfoContent() {
70
70
'### To include localization',
71
71
'',
72
72
'Plotly.js defaults to US English (en-US) and includes British English (en) in the standard bundle.',
73
-
'Many other localizations are available - here is an example using Swiss-German (de-CH),',
74
-
'see the contents of this directory for the full list.',
75
-
'They are also available on our CDN as '+cdnRoot+'locale-de-ch-latest.js OR '+cdnRoot+'locale-de-ch-'+pkg.version+'.js',
76
-
'Note that the file names are all lowercase, even though the region is uppercase when you apply a locale.',
73
+
'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.',
77
74
'',
78
-
'*After* the plotly.js script tag, add:',
75
+
'#### Loading and registering locales',
76
+
'',
77
+
'Some locales build on other locales (e.g., "de-CH" builds on "de"). In this case, first load the base locale (e.g., "de"), then load the actual locale (e.g., "de-CH"):',
79
78
'',
80
79
'```html',
80
+
'<script src="plotly-locale-de.js"></script>',
81
81
'<script src="plotly-locale-de-ch.js"></script>',
82
+
'```',
83
+
'',
84
+
'Locale bundles are also available on our CDN (e.g., '+cdnRoot+'locale-de-ch-latest.js OR '+cdnRoot+'locale-de-ch-'+pkg.version+'.js). Note that the file names here are all lowercase, but the region is uppercase when you apply a locale.',
85
+
'',
86
+
'#### Apply a locale',
87
+
'',
88
+
'After registering a locale, you can it as the default for all Plotly plots:',
0 commit comments