diff --git a/src/language-helper.js b/src/language-helper.js index e3a8231..0a41f69 100644 --- a/src/language-helper.js +++ b/src/language-helper.js @@ -56,10 +56,10 @@ function _t(text, variables = {}) { } class AppLocalization { - static STORE_KEY = "locale" - store = null - constructor({ store, components = [] }) { + // TODO: Should be static field, but that doesn't parse without Babel + this.STORE_KEY = "locale"; + counterpart.registerTranslations("en", this.fetchTranslationJson("en_EN")); counterpart.setFallbackLocale('en'); counterpart.setSeparator('|'); @@ -69,8 +69,8 @@ class AppLocalization { } this.store = store; - if (this.store.has(AppLocalization.STORE_KEY)) { - const locales = this.store.get(AppLocalization.STORE_KEY); + if (this.store.has(this.STORE_KEY)) { + const locales = this.store.get(this.STORE_KEY); this.setAppLocale(locales); } @@ -106,7 +106,7 @@ class AppLocalization { }); counterpart.setLocale(locales); - this.store.set(AppLocalization.STORE_KEY, locales); + this.store.set(this.STORE_KEY, locales); this.resetLocalizedUI(); }