File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,12 @@ register([
6565 require ( './locale-en-us' )
6666] ) ;
6767
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+
6874// plot icons
6975exports . Icons = require ( './fonts/ploticon' ) ;
7076
Original file line number Diff line number Diff line change @@ -6,8 +6,8 @@ var intoStream = require('into-stream');
66
77var constants = require ( './constants' ) ;
88
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);} ' ;
1111
1212var moduleMarker = 'module.exports = ' ;
1313
You can’t perform that action at this time.
0 commit comments