Skip to content

Commit b4b20a7

Browse files
committed
locales: stash under window.PlotlyConfig.locales instead of window.PlotlyLocales
1 parent f169380 commit b4b20a7

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Diff for: src/core.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ register([
6666
]);
6767

6868
// locales that are present in the window should be loaded
69-
if(window.PlotlyLocales && Array.isArray(window.PlotlyLocales)) {
70-
register(window.PlotlyLocales);
71-
delete window.PlotlyLocales;
69+
if(window.PlotlyConfig && window.PlotlyConfig.locales) {
70+
register(window.PlotlyConfig.locales);
71+
delete window.PlotlyConfig.locales;
7272
}
7373

7474
// plot icons

Diff for: tasks/util/wrap_locale.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ var intoStream = require('into-stream');
77
var constants = require('./constants');
88

99
var prefix = 'var locale=';
10-
var suffix = ';if(typeof Plotly === \'undefined\') {window.PlotlyLocales = window.PlotlyLocales || []; window.PlotlyLocales.push(locale);} else {Plotly.register(locale);}';
10+
var suffix = ';window.PlotlyConfig = window.PlotlyConfig || {};';
11+
suffix += 'if(typeof Plotly === \'undefined\') {window.PlotlyConfig.locales = window.PlotlyConfig.locales || []; window.PlotlyConfig.locales.push(locale);} else {Plotly.register(locale);}';
1112

1213
var moduleMarker = 'module.exports = ';
1314

0 commit comments

Comments
 (0)