diff options
author | Christopher Speller <crspeller@gmail.com> | 2016-03-21 12:33:44 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2016-03-21 14:32:37 -0400 |
commit | d7b19dd50f2fb13167a07a39fc7d2fd72485a8c0 (patch) | |
tree | fa2b9bee200106898f99851edcf726202c8d2613 /webapp/root.jsx | |
parent | 0db6994e08d6a83cc986ee559632f198d1b2b4fa (diff) | |
download | chat-d7b19dd50f2fb13167a07a39fc7d2fd72485a8c0.tar.gz chat-d7b19dd50f2fb13167a07a39fc7d2fd72485a8c0.tar.bz2 chat-d7b19dd50f2fb13167a07a39fc7d2fd72485a8c0.zip |
Fixing intl on Safari
Diffstat (limited to 'webapp/root.jsx')
-rw-r--r-- | webapp/root.jsx | 27 |
1 files changed, 23 insertions, 4 deletions
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) { |