From d36d977a01b4796be38767d20e5e77283b023453 Mon Sep 17 00:00:00 2001
From: Christopher Speller <crspeller@gmail.com>
Date: Thu, 24 Mar 2016 12:05:50 -0400
Subject: Consolidating i18n stuff into i18n.jsx

---
 webapp/i18n/i18n.jsx | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

(limited to 'webapp/i18n/i18n.jsx')

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);
+}
-- 
cgit v1.2.3-1-g7c22

