Skip to content

Commit

Permalink
enable loading locales before Plotly
Browse files Browse the repository at this point in the history
  • Loading branch information
antoinerg committed Dec 30, 2019
1 parent 0c4cebb commit 6940aac
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ register([
require('./locale-en-us')
]);

// locales that are present in the window should be loaded
if(window.PlotlyLocales && window.PlotlyLocales.length) {
register(window.PlotlyLocales);
}

// plot icons
exports.Icons = require('./fonts/ploticon');

Expand Down
4 changes: 2 additions & 2 deletions tasks/util/wrap_locale.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ var intoStream = require('into-stream');

var constants = require('./constants');

var prefix = 'Plotly.register(';
var suffix = ');';
var prefix = 'var locale=';
var suffix = ';if(typeof Plotly === \'undefined\') {window.PlotlyLocales = window.PlotlyLocales || []; window.PlotlyLocales.push(locale);} else {Plotly.register(locale);}';

var moduleMarker = 'module.exports = ';

Expand Down

0 comments on commit 6940aac

Please sign in to comment.