diff options
-rw-r--r-- | webapp/package.json | 1 | ||||
-rw-r--r-- | webapp/root.jsx | 27 |
2 files changed, 24 insertions, 4 deletions
diff --git a/webapp/package.json b/webapp/package.json index 0c3e9313e..cdfba8ef0 100644 --- a/webapp/package.json +++ b/webapp/package.json @@ -11,6 +11,7 @@ "fastclick": "1.0.6", "flux": "2.1.1", "highlight.js": "9.2.0", + "intl": "1.1.0", "jasny-bootstrap": "3.1.3", "jquery": "2.2.1", "keymirror": "0.1.1", diff --git a/webapp/root.jsx b/webapp/root.jsx index 2ce220f1d..b0a6ae1ac 100644 --- a/webapp/root.jsx +++ b/webapp/root.jsx @@ -109,11 +109,30 @@ function preRenderSetup(callwhendone) { } ); - addLocaleData(enLocaleData); - addLocaleData(esLocaleData); - addLocaleData(ptLocaleData); + function afterIntl() { + addLocaleData(enLocaleData); + addLocaleData(esLocaleData); + addLocaleData(ptLocaleData); - $.when(d1, d2).done(callwhendone); + $.when(d1, d2).done(callwhendone); + } + + if (global.Intl) { + afterIntl(); + } else { + require.ensure([ + 'intl', + 'intl/locale-data/jsonp/en.js', + 'intl/locale-data/jsonp/es.js', + 'intl/locale-data/jsonp/pt.js' + ], (require) => { + require('intl'); + require('intl/locale-data/jsonp/en.js'); + require('intl/locale-data/jsonp/es.js'); + require('intl/locale-data/jsonp/pt.js'); + afterIntl(); + }); + } } function preLoggedIn(nextState, replace, callback) { |