mirror of
https://github.com/CringeStudios/element-desktop.git
synced 2025-01-31 13:39:58 +01:00
Fall back to instance properties
This commit is contained in:
parent
1455687384
commit
bc0f370821
@ -56,10 +56,10 @@ function _t(text, variables = {}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class AppLocalization {
|
class AppLocalization {
|
||||||
static STORE_KEY = "locale"
|
|
||||||
store = null
|
|
||||||
|
|
||||||
constructor({ store, components = [] }) {
|
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.registerTranslations("en", this.fetchTranslationJson("en_EN"));
|
||||||
counterpart.setFallbackLocale('en');
|
counterpart.setFallbackLocale('en');
|
||||||
counterpart.setSeparator('|');
|
counterpart.setSeparator('|');
|
||||||
@ -69,8 +69,8 @@ class AppLocalization {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.store = store;
|
this.store = store;
|
||||||
if (this.store.has(AppLocalization.STORE_KEY)) {
|
if (this.store.has(this.STORE_KEY)) {
|
||||||
const locales = this.store.get(AppLocalization.STORE_KEY);
|
const locales = this.store.get(this.STORE_KEY);
|
||||||
this.setAppLocale(locales);
|
this.setAppLocale(locales);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -106,7 +106,7 @@ class AppLocalization {
|
|||||||
});
|
});
|
||||||
|
|
||||||
counterpart.setLocale(locales);
|
counterpart.setLocale(locales);
|
||||||
this.store.set(AppLocalization.STORE_KEY, locales);
|
this.store.set(this.STORE_KEY, locales);
|
||||||
|
|
||||||
this.resetLocalizedUI();
|
this.resetLocalizedUI();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user