File tree 2 files changed +8
-2
lines changed
2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,12 @@ register([
65
65
require ( './locale-en-us' )
66
66
] ) ;
67
67
68
+ // 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 ;
72
+ }
73
+
68
74
// plot icons
69
75
exports . Icons = require ( './fonts/ploticon' ) ;
70
76
Original file line number Diff line number Diff line change @@ -6,8 +6,8 @@ var intoStream = require('into-stream');
6
6
7
7
var constants = require ( './constants' ) ;
8
8
9
- var prefix = 'Plotly.register( ' ;
10
- var suffix = '); ' ;
9
+ var prefix = 'var locale= ' ;
10
+ var suffix = ';if(typeof Plotly === \'undefined\') {window.PlotlyLocales = window.PlotlyLocales || []; window.PlotlyLocales.push(locale);} else {Plotly.register(locale);} ' ;
11
11
12
12
var moduleMarker = 'module.exports = ' ;
13
13
You can’t perform that action at this time.
0 commit comments