Skip to content

Commit 0dc2eb7

Browse files
authored
Merge pull request #2207 from plotly/i18n-dates
Date and number localization
2 parents 521bd55 + 331b2da commit 0dc2eb7

File tree

183 files changed

+2868
-209
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

183 files changed

+2868
-209
lines changed

dist/README.md

+29-5
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,46 @@ or the un-minified version as:
1414
<script type="text/javascript" src="plotly.js" charset="utf-8"></script>
1515
```
1616

17-
To support IE9, put:
17+
### To support IE9
18+
19+
*Before* the plotly.js script tag, add:
1820

1921
```html
2022
<script>if(typeof window.Int16Array !== 'function')document.write("<scri"+"pt src='extras/typedarray.min.js'></scr"+"ipt>");</script>
2123
<script>document.write("<scri"+"pt src='extras/request_animation_frame.js'></scr"+"ipt>");</script>
2224
```
2325

24-
before the plotly.js script tag.
26+
### To support MathJax
2527

26-
To add MathJax, put
28+
*Before* the plotly.js script tag, add:
2729

2830
```html
2931
<script type="text/javascript" src="mathjax/MathJax.js?config=TeX-AMS-MML_SVG"></script>
3032
```
3133

32-
before the plotly.js script tag. You can grab the relevant MathJax files in `./dist/extras/mathjax/`.
34+
You can grab the relevant MathJax files in `./dist/extras/mathjax/`.
35+
36+
### To include localization
37+
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.31.2.js
42+
Note that the file names are all lowercase, even though the region is uppercase when you apply a locale.
43+
44+
*After* the plotly.js script tag, add:
45+
46+
```html
47+
<script type="text/javascript" src="plotly-locale-de-ch.js"></script>
48+
<script type="text/javascript">Plotly.setPlotConfig({locale: 'de-CH'})</script>
49+
```
50+
51+
The first line loads and registers the locale definition with plotly.js, the second sets it as the default for all Plotly plots.
52+
You can also include multiple locale definitions and apply them to each plot separately as a `config` parameter:
53+
54+
```js
55+
Plotly.newPlot(graphDiv, data, layout, {locale: 'de-CH'})
56+
```
3357

3458
# Bundle information
3559

@@ -84,7 +108,7 @@ The `basic` partial bundle contains the `scatter`, `bar` and `pie` trace modules
84108

85109
### plotly.js cartesian
86110

87-
The `cartesian` partial bundle contains the `scatter`, `bar`, `box`, `heatmap`, `histogram`, `histogram2d`, `histogram2dcontour`, `pie`, `contour` and `scatterternary` trace modules.
111+
The `cartesian` partial bundle contains the `scatter`, `bar`, `box`, `heatmap`, `histogram`, `histogram2d`, `histogram2dcontour`, `pie`, `contour`, `scatterternary` and `violin` trace modules.
88112

89113
| Way to import | Location |
90114
|---------------|----------|

dist/plotly-locale-af.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/plotly-locale-am.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/plotly-locale-ar-dz.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/plotly-locale-ar-eg.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/plotly-locale-ar.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/plotly-locale-az.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/plotly-locale-bg.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/plotly-locale-bs.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/plotly-locale-ca.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/plotly-locale-cs.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/plotly-locale-da.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/plotly-locale-de-ch.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/plotly-locale-de.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/plotly-locale-el.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/plotly-locale-en-us.js

-1
This file was deleted.

dist/plotly-locale-en.js

-1
This file was deleted.

dist/plotly-locale-eo.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/plotly-locale-es-ar.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/plotly-locale-es-pe.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/plotly-locale-es.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/plotly-locale-et.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/plotly-locale-eu.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/plotly-locale-fa.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/plotly-locale-fi.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/plotly-locale-fo.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/plotly-locale-fr-ch.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/plotly-locale-fr.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)