diff options
| author | Oskar Nyberg <oskar@mullvad.net> | 2021-07-13 11:33:01 +0200 |
|---|---|---|
| committer | Oskar Nyberg <oskar@mullvad.net> | 2021-07-13 11:33:01 +0200 |
| commit | e90ce9647a18110f2d1de15b2aa2038b11ee5588 (patch) | |
| tree | bbaaafc630539ea327797ebe78ee06e2c428b91f | |
| parent | 51c3233e7f2f7dbf11f11345b378ff58190b72fc (diff) | |
| download | mullvadvpn-e90ce9647a18110f2d1de15b2aa2038b11ee5588.tar.xz mullvadvpn-e90ce9647a18110f2d1de15b2aa2038b11ee5588.zip | |
Save new translations when switching language
| -rw-r--r-- | gui/src/main/index.ts | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gui/src/main/index.ts b/gui/src/main/index.ts index 8cacf4a7b7..d778f02abe 100644 --- a/gui/src/main/index.ts +++ b/gui/src/main/index.ts @@ -425,7 +425,7 @@ class ApplicationMain { // Blocks navigation since it's not needed. this.blockNavigation(); - this.translations = this.updateCurrentLocale(); + this.updateCurrentLocale(); this.daemonRpc.addConnectionObserver( new ConnectionObserver(this.onDaemonConnected, this.onDaemonDisconnected), @@ -1153,7 +1153,8 @@ class ApplicationMain { IpcMainEventChannel.guiSettings.handleSetPreferredLocale((locale: string) => { this.guiSettings.preferredLocale = locale; - return Promise.resolve(this.updateCurrentLocale()); + this.updateCurrentLocale(); + return Promise.resolve(this.translations); }); IpcMainEventChannel.account.handleCreate(() => this.createNewAccount()); @@ -1526,7 +1527,8 @@ class ApplicationMain { const messagesTranslations = loadTranslations(this.locale, messages); const relayLocationsTranslations = loadTranslations(this.locale, relayLocations); - return { + + this.translations = { locale: this.locale, messages: messagesTranslations, relayLocations: relayLocationsTranslations, |
