From 7dec89ddb39050d63a76485895c3bc13d837061c Mon Sep 17 00:00:00 2001 From: Tim Mickel Date: Wed, 13 Jan 2016 14:51:47 -0500 Subject: [PATCH] Fix localization includes and remove default locale messages --- src/utils/Localization.js | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/src/utils/Localization.js b/src/utils/Localization.js index 7ed0bb9..a18af2e 100644 --- a/src/utils/Localization.js +++ b/src/utils/Localization.js @@ -1,14 +1,15 @@ import Cookie from './Cookie'; +import Intl from 'intl'; import IntlMessageFormat from 'intl-messageformat'; +window.Intl = Intl; + let currentLocale; let root = ''; let localizationMessages = {}; -let defaultLocalizationMessages = {}; // Configuration const defaultLocale = window.Settings.defaultLocale; -const defaultLocaleShort = window.Settings.defaultLocaleShort; const supportedLocales = window.Settings.supportedLocales; const sampleKeyPrefix = 'key_'; @@ -48,6 +49,7 @@ export default class Localization { // Call this when the app is initialized static includeLocales () { var localizationCookie = Cookie.get('localization'); + if (localizationCookie === null) { currentLocale = this.determineLocaleFromBrowser(); } else { @@ -55,25 +57,11 @@ export default class Localization { } var topLevel = currentLocale.split('-')[0]; - // Intl locale-data - document.write('