From 1a0c741fcd92a28b5c766a996cc66b65092a9731 Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Thu, 20 Oct 2016 18:54:55 -0400 Subject: [PATCH] Added Intl polyfill for platforms that don't support it (#49) --- Makefile | 6 +++--- package.json | 1 + src/i18n/i18n.js | 2 ++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 397925290..9ed56d0b6 100644 --- a/Makefile +++ b/Makefile @@ -62,9 +62,9 @@ clean: rm -f .npminstall post-install: - # Hack to get react-intl and its dependencies to work with react-native - # Based off of https://github.com/este/este/blob/master/gulp/native-fix.js + @# Hack to get react-intl and its dependencies to work with react-native + @# Based off of https://github.com/este/este/blob/master/gulp/native-fix.js sed -i'' -e 's|"./locale-data/index.js": false|"./locale-data/index.js": "./locale-data/index.js"|g' node_modules/react-intl/package.json sed -i'' -e 's|"./lib/locales": false|"./lib/locales": "./lib/locales"|g' node_modules/intl-messageformat/package.json sed -i'' -e 's|"./lib/locales": false|"./lib/locales": "./lib/locales"|g' node_modules/intl-relativeformat/package.json - # sed -i'' -e 's|"./locale-data/complete.js": false|"./locale-data/complete.js": "./locale-data/complete.js"|g' node_modules/intl/package.json + sed -i'' -e 's|"./locale-data/complete.js": false|"./locale-data/complete.js": "./locale-data/complete.js"|g' node_modules/intl/package.json diff --git a/package.json b/package.json index e7d13bcf1..217f1b9ea 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "0.0.1", "private": true, "dependencies": { + "intl": "1.2.5", "isomorphic-fetch": "2.2.1", "lodash": "4.16.4", "react": "15.3.2", diff --git a/src/i18n/i18n.js b/src/i18n/i18n.js index 42e54af1e..e41ba3818 100644 --- a/src/i18n/i18n.js +++ b/src/i18n/i18n.js @@ -1,6 +1,8 @@ // Copyright (c) 2016 Mattermost, Inc. All Rights Reserved. // See License.txt for license information. +import 'intl'; + import en from 'i18n/en.json'; import es from 'i18n/es.json';