From a3165bf1bacf3937b291cfc38d06735d4e5fbe10 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Mon, 8 Jun 2026 15:38:50 -0400 Subject: [PATCH] fix(settings): fix language toggle to keep its binding --- .../AppLayouts/Profile/views/AdvancedView.qml | 26 +++++++++++++------ ui/i18n/qml_base_en.ts | 8 +++--- ui/i18n/qml_base_lokalise_en.ts | 16 ++++++------ ui/i18n/qml_cs.ts | 12 ++++----- ui/i18n/qml_es.ts | 12 ++++----- ui/i18n/qml_ko.ts | 12 ++++----- 6 files changed, 48 insertions(+), 38 deletions(-) diff --git a/ui/app/AppLayouts/Profile/views/AdvancedView.qml b/ui/app/AppLayouts/Profile/views/AdvancedView.qml index 0bb3290b77..ca904c7e20 100644 --- a/ui/app/AppLayouts/Profile/views/AdvancedView.qml +++ b/ui/app/AppLayouts/Profile/views/AdvancedView.qml @@ -314,10 +314,14 @@ SettingsContentBase { text: qsTr("Enable translations") isSwitch: true checked: localAppSettings.translationsEnabled - onToggled: { - localAppSettings.translationsEnabled = !localAppSettings.translationsEnabled - if (!checked) + onClicked: { + checked = Qt.binding(() => localAppSettings.translationsEnabled) + + if (checked) { Global.openPopup(disableLanguagesPopupComponent) + } else { + localAppSettings.translationsEnabled = true + } } } @@ -326,9 +330,13 @@ SettingsContentBase { ConfirmationDialog { destroyOnClose: true headerSettings.title: qsTr("Language reset") - confirmationText: qsTr("Display language will be switched back to English. The app will restart if you confirm.") + confirmationText: qsTr("Display language will be switched back to English.") + "\n" + + qsTr("The app will restart if you confirm.") confirmButtonLabel: qsTr("Restart") - onConfirmButtonClicked: SystemUtils.restartApplication() + onConfirmButtonClicked: { + localAppSettings.translationsEnabled = false + SystemUtils.restartApplication() + } } } @@ -413,9 +421,11 @@ SettingsContentBase { id: confirmDialog destroyOnClose: true showCancelButton: true - confirmationText: qsTr("Are you sure you want to %1 debug mode? The app will restart if you confirm.").arg(root.advancedStore.isDebugEnabled ? - qsTr("disable") : - qsTr("enable")) + confirmationText: (root.advancedStore.isDebugEnabled ? + qsTr("Are you sure you want to disable debug mode?") : + qsTr("Are you sure you want to enable debug mode?")) + + "\n" + + qsTr("The app will restart if you confirm.") onConfirmButtonClicked: { root.advancedStore.toggleDebug() SystemUtils.restartApplication() diff --git a/ui/i18n/qml_base_en.ts b/ui/i18n/qml_base_en.ts index 6d0d7e723d..d1341d6ed0 100644 --- a/ui/i18n/qml_base_en.ts +++ b/ui/i18n/qml_base_en.ts @@ -1107,11 +1107,11 @@ - Display language will be switched back to English. The app will restart if you confirm. + Display language will be switched back to English. - Are you sure you want to %1 debug mode? The app will restart if you confirm. + The app will restart if you confirm. @@ -1143,11 +1143,11 @@ - disable + Are you sure you want to disable debug mode? - enable + Are you sure you want to enable debug mode? diff --git a/ui/i18n/qml_base_lokalise_en.ts b/ui/i18n/qml_base_lokalise_en.ts index 1274698405..13ec048754 100644 --- a/ui/i18n/qml_base_lokalise_en.ts +++ b/ui/i18n/qml_base_lokalise_en.ts @@ -1358,14 +1358,14 @@ Language reset - Display language will be switched back to English. The app will restart if you confirm. + Display language will be switched back to English. AdvancedView - Display language will be switched back to English. The app will restart if you confirm. + Display language will be switched back to English. - Are you sure you want to %1 debug mode? The app will restart if you confirm. + The app will restart if you confirm. AdvancedView - Are you sure you want to %1 debug mode? The app will restart if you confirm. + The app will restart if you confirm. Restart @@ -1403,14 +1403,14 @@ RPC statistics - disable + Are you sure you want to disable debug mode? AdvancedView - disable + Are you sure you want to disable debug mode? - enable + Are you sure you want to enable debug mode? AdvancedView - enable + Are you sure you want to enable debug mode? How many log files do you want to keep archived? diff --git a/ui/i18n/qml_cs.ts b/ui/i18n/qml_cs.ts index e79f1c529a..f5778a4c21 100644 --- a/ui/i18n/qml_cs.ts +++ b/ui/i18n/qml_cs.ts @@ -1110,11 +1110,11 @@ Reset jazyka - Display language will be switched back to English. The app will restart if you confirm. + Display language will be switched back to English. - Are you sure you want to %1 debug mode? The app will restart if you confirm. + The app will restart if you confirm. @@ -1146,12 +1146,12 @@ Statistiky RPC - disable - zakázat + Are you sure you want to disable debug mode? + - enable - povolit + Are you sure you want to enable debug mode? + How many log files do you want to keep archived? diff --git a/ui/i18n/qml_es.ts b/ui/i18n/qml_es.ts index d0af5bca61..60f0b4f5ca 100644 --- a/ui/i18n/qml_es.ts +++ b/ui/i18n/qml_es.ts @@ -1107,11 +1107,11 @@ Restablecer idioma - Display language will be switched back to English. The app will restart if you confirm. + Display language will be switched back to English. - Are you sure you want to %1 debug mode? The app will restart if you confirm. + The app will restart if you confirm. @@ -1143,12 +1143,12 @@ Estadísticas RPC - disable - deshabilitar + Are you sure you want to disable debug mode? + - enable - habilitar + Are you sure you want to enable debug mode? + How many log files do you want to keep archived? diff --git a/ui/i18n/qml_ko.ts b/ui/i18n/qml_ko.ts index b97c087354..ff3dc23aef 100644 --- a/ui/i18n/qml_ko.ts +++ b/ui/i18n/qml_ko.ts @@ -1104,11 +1104,11 @@ 언어 초기화 - Display language will be switched back to English. The app will restart if you confirm. + Display language will be switched back to English. - Are you sure you want to %1 debug mode? The app will restart if you confirm. + The app will restart if you confirm. @@ -1140,12 +1140,12 @@ rpc 통계 - disable - 비활성화 + Are you sure you want to disable debug mode? + - enable - 활성화 + Are you sure you want to enable debug mode? + How many log files do you want to keep archived?