mirror of
https://github.com/CringeStudios/element-desktop.git
synced 2025-01-18 23:44:59 +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 {
|
||||
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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user