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('