Skip to content

Commit 04ed6f0

Browse files
committed
set default locale to en-US and build this into the library
gives an example of what these locales should look like as modules
1 parent bf2c6db commit 04ed6f0

12 files changed

+73
-1
lines changed

lib/index-basic.js

+3
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,7 @@ Plotly.register([
1515
require('./pie')
1616
]);
1717

18+
// locales
19+
Plotly.register(require('./locales.js'));
20+
1821
module.exports = Plotly;

lib/index-cartesian.js

+3
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,7 @@ Plotly.register([
2323
require('./violin')
2424
]);
2525

26+
// locales
27+
Plotly.register(require('./locales.js'));
28+
2629
module.exports = Plotly;

lib/index-finance.js

+3
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,7 @@ Plotly.register([
1818
require('./candlestick')
1919
]);
2020

21+
// locales
22+
Plotly.register(require('./locales.js'));
23+
2124
module.exports = Plotly;

lib/index-geo.js

+3
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,7 @@ Plotly.register([
1515
require('./choropleth')
1616
]);
1717

18+
// locales
19+
Plotly.register(require('./locales.js'));
20+
1821
module.exports = Plotly;

lib/index-gl2d.js

+3
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,7 @@ Plotly.register([
1818
require('./parcoords')
1919
]);
2020

21+
// locales
22+
Plotly.register(require('./locales.js'));
23+
2124
module.exports = Plotly;

lib/index-gl3d.js

+3
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,7 @@ Plotly.register([
1616
require('./mesh3d')
1717
]);
1818

19+
// locales
20+
Plotly.register(require('./locales.js'));
21+
1922
module.exports = Plotly;

lib/index-mapbox.js

+3
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,7 @@ Plotly.register([
1414
require('./scattermapbox')
1515
]);
1616

17+
// locales
18+
Plotly.register(require('./locales.js'));
19+
1720
module.exports = Plotly;

lib/index.js

+3
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,7 @@ Plotly.register([
7171
require('./calendars')
7272
]);
7373

74+
// locales
75+
Plotly.register(require('./locales.js'));
76+
7477
module.exports = Plotly;

lib/locale-en-us.js

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* Copyright 2012-2017, Plotly, Inc.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the MIT license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
8+
9+
'use strict';
10+
11+
module.exports = {
12+
moduleType: 'locale',
13+
name: 'en-US',
14+
dictionary: {
15+
'Click to enter Colorscale title': 'Click to enter Colorscale title'
16+
}
17+
};

lib/locale-en.js

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* Copyright 2012-2017, Plotly, Inc.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the MIT license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
8+
9+
'use strict';
10+
11+
module.exports = {
12+
moduleType: 'locale',
13+
name: 'en',
14+
dictionary: {
15+
'Click to enter Colorscale title': 'Click to enter Colourscale title'
16+
}
17+
};

lib/locales.js

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/**
2+
* Copyright 2012-2017, Plotly, Inc.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the MIT license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
8+
9+
'use strict';
10+
11+
module.exports = [
12+
require('./locale-en.js'),
13+
require('./locale-en-us.js')
14+
];

src/plot_api/plot_config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ module.exports = {
130130

131131
// Which localization should we use?
132132
// Should be a string like 'en' or 'en-US'.
133-
locale: 'en',
133+
locale: 'en-US',
134134

135135
// Localization dictionaries
136136
// Dictionaries can be provided either here (specific to one chart) or globally

0 commit comments

Comments
 (0)