From 799b61f6a777009d8aee567325708370dd09bef9 Mon Sep 17 00:00:00 2001 From: Zack Rauen Date: Fri, 27 Oct 2023 22:10:46 -0400 Subject: [PATCH] Fix an issue with updating translations --- renderer/src/modules/localemanager.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/renderer/src/modules/localemanager.js b/renderer/src/modules/localemanager.js index 442e0cae..dcbd7a80 100644 --- a/renderer/src/modules/localemanager.js +++ b/renderer/src/modules/localemanager.js @@ -16,20 +16,20 @@ export default new class LocaleManager { } initialize() { - this.setLocale(this.discordLocale); - LocaleStore?.addChangeListener((newLocale) => this.setLocale(newLocale)); + this.setLocale(); + LocaleStore?.addChangeListener(() => this.setLocale()); } - setLocale(newLocale) { + setLocale() { let newStrings; - if (newLocale != this.defaultLocale) { - newStrings = Locales[newLocale]; + if (this.discordLocale != this.defaultLocale) { + newStrings = Locales[this.discordLocale]; if (!newStrings) return this.setLocale(this.defaultLocale); } else { newStrings = Locales[this.defaultLocale]; } - this.locale = newLocale; + this.locale = this.discordLocale; Utilities.extendTruthy(this.strings, newStrings); Events.emit("strings-updated"); }