From ac823079ac6a5e3029ebcc0a1850f970afca4be5 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Tue, 2 Nov 2021 15:31:51 -0400 Subject: [PATCH] fix(profile): fix changing language Fixes #4000 --- src/app/boot/app_controller.nim | 1 + src/app_service/service/language/service.nim | 4 ---- ui/app/AppLayouts/Profile/stores/RootStore.qml | 1 + 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/app/boot/app_controller.nim b/src/app/boot/app_controller.nim index ecda2946bb..458a311db6 100644 --- a/src/app/boot/app_controller.nim +++ b/src/app/boot/app_controller.nim @@ -260,6 +260,7 @@ proc load*(self: AppController) = singletonInstance.engine.setRootContextProperty("localAccountSensitiveSettings", self.localAccountSensitiveSettingsVariant) ################################################# + self.languageService.init() self.settingService.init() self.contactsService.init() self.chatService.init() diff --git a/src/app_service/service/language/service.nim b/src/app_service/service/language/service.nim index 137b31580d..f6f3cc54fd 100644 --- a/src/app_service/service/language/service.nim +++ b/src/app_service/service/language/service.nim @@ -21,8 +21,6 @@ proc newService*(): Service = method init*(self: Service) = try: - echo "init" - self.i18nPath = "" if defined(development): self.i18nPath = joinPath(getAppDir(), "../ui/i18n") @@ -39,8 +37,6 @@ method init*(self: Service) = return method setLanguage*(self: Service, locale: string) = - echo "---------------" - echo "--- setting language" if (locale == self.currentLanguageCode): return self.currentLanguageCode = locale diff --git a/ui/app/AppLayouts/Profile/stores/RootStore.qml b/ui/app/AppLayouts/Profile/stores/RootStore.qml index 922b241fd9..94f696eff0 100644 --- a/ui/app/AppLayouts/Profile/stores/RootStore.qml +++ b/ui/app/AppLayouts/Profile/stores/RootStore.qml @@ -279,6 +279,7 @@ QtObject { } function changeLocale(l) { + localAppSettings.locale = l languageModuleInst.changeLocale(l) }