diff options
author | Christopher Speller <crspeller@gmail.com> | 2016-03-24 12:05:50 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2016-03-24 12:08:28 -0400 |
commit | d36d977a01b4796be38767d20e5e77283b023453 (patch) | |
tree | ec96a8a4efa38bc3cd0b7d0bd551ca35cfcdcbc2 /webapp/i18n/i18n.jsx | |
parent | 68dad8c7345b12c7d0b10709ddc1873d4b40163e (diff) | |
download | chat-d36d977a01b4796be38767d20e5e77283b023453.tar.gz chat-d36d977a01b4796be38767d20e5e77283b023453.tar.bz2 chat-d36d977a01b4796be38767d20e5e77283b023453.zip |
Consolidating i18n stuff into i18n.jsx
Diffstat (limited to 'webapp/i18n/i18n.jsx')
-rw-r--r-- | webapp/i18n/i18n.jsx | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/webapp/i18n/i18n.jsx b/webapp/i18n/i18n.jsx index fde1fbb64..6fed6b831 100644 --- a/webapp/i18n/i18n.jsx +++ b/webapp/i18n/i18n.jsx @@ -4,6 +4,11 @@ const es = require('!!file?name=i18n/[name].[ext]!./es.json'); const pt = require('!!file?name=i18n/[name].[ext]!./pt.json'); +import {addLocaleData} from 'react-intl'; +import enLocaleData from 'react-intl/locale-data/en'; +import esLocaleData from 'react-intl/locale-data/es'; +import ptLocaleData from 'react-intl/locale-data/pt'; + const languages = { en: { value: 'en', @@ -29,3 +34,24 @@ export function getLanguages() { export function getLanguageInfo(locale) { return languages[locale]; } + +export function safariFix(callback) { + 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'); + callback(); + }); +} + +export function doAddLocaleData() { + addLocaleData(enLocaleData); + addLocaleData(esLocaleData); + addLocaleData(ptLocaleData); +} |