fix(settings): fix language toggle to keep its binding

This commit is contained in:
Jonathan Rainville
2026-06-16 14:22:16 -04:00
parent 9e8ef0589f
commit a3165bf1ba
6 changed files with 48 additions and 38 deletions
@@ -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()
+4 -4
View File
@@ -1107,11 +1107,11 @@
<translation type="unfinished"></translation>
</message>
<message>
<source>Display language will be switched back to English. The app will restart if you confirm.</source>
<source>Display language will be switched back to English.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Are you sure you want to %1 debug mode? The app will restart if you confirm.</source>
<source>The app will restart if you confirm.</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -1143,11 +1143,11 @@
<translation type="unfinished"></translation>
</message>
<message>
<source>disable</source>
<source>Are you sure you want to disable debug mode?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>enable</source>
<source>Are you sure you want to enable debug mode?</source>
<translation type="unfinished"></translation>
</message>
<message>
+8 -8
View File
@@ -1358,14 +1358,14 @@
<translation>Language reset</translation>
</message>
<message>
<source>Display language will be switched back to English. The app will restart if you confirm.</source>
<source>Display language will be switched back to English.</source>
<comment>AdvancedView</comment>
<translation>Display language will be switched back to English. The app will restart if you confirm.</translation>
<translation>Display language will be switched back to English.</translation>
</message>
<message>
<source>Are you sure you want to %1 debug mode? The app will restart if you confirm.</source>
<source>The app will restart if you confirm.</source>
<comment>AdvancedView</comment>
<translation>Are you sure you want to %1 debug mode? The app will restart if you confirm.</translation>
<translation>The app will restart if you confirm.</translation>
</message>
<message>
<source>Restart</source>
@@ -1403,14 +1403,14 @@
<translation>RPC statistics</translation>
</message>
<message>
<source>disable</source>
<source>Are you sure you want to disable debug mode?</source>
<comment>AdvancedView</comment>
<translation>disable</translation>
<translation>Are you sure you want to disable debug mode?</translation>
</message>
<message>
<source>enable</source>
<source>Are you sure you want to enable debug mode?</source>
<comment>AdvancedView</comment>
<translation>enable</translation>
<translation>Are you sure you want to enable debug mode?</translation>
</message>
<message>
<source>How many log files do you want to keep archived?</source>
+6 -6
View File
@@ -1110,11 +1110,11 @@
<translation>Reset jazyka</translation>
</message>
<message>
<source>Display language will be switched back to English. The app will restart if you confirm.</source>
<source>Display language will be switched back to English.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Are you sure you want to %1 debug mode? The app will restart if you confirm.</source>
<source>The app will restart if you confirm.</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -1146,12 +1146,12 @@
<translation>Statistiky RPC</translation>
</message>
<message>
<source>disable</source>
<translation>zakázat</translation>
<source>Are you sure you want to disable debug mode?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>enable</source>
<translation>povolit</translation>
<source>Are you sure you want to enable debug mode?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>How many log files do you want to keep archived?</source>
+6 -6
View File
@@ -1107,11 +1107,11 @@
<translation>Restablecer idioma</translation>
</message>
<message>
<source>Display language will be switched back to English. The app will restart if you confirm.</source>
<source>Display language will be switched back to English.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Are you sure you want to %1 debug mode? The app will restart if you confirm.</source>
<source>The app will restart if you confirm.</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -1143,12 +1143,12 @@
<translation>Estadísticas RPC</translation>
</message>
<message>
<source>disable</source>
<translation>deshabilitar</translation>
<source>Are you sure you want to disable debug mode?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>enable</source>
<translation>habilitar</translation>
<source>Are you sure you want to enable debug mode?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>How many log files do you want to keep archived?</source>
+6 -6
View File
@@ -1104,11 +1104,11 @@
<translation> </translation>
</message>
<message>
<source>Display language will be switched back to English. The app will restart if you confirm.</source>
<source>Display language will be switched back to English.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Are you sure you want to %1 debug mode? The app will restart if you confirm.</source>
<source>The app will restart if you confirm.</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -1140,12 +1140,12 @@
<translation>rpc </translation>
</message>
<message>
<source>disable</source>
<translation></translation>
<source>Are you sure you want to disable debug mode?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>enable</source>
<translation></translation>
<source>Are you sure you want to enable debug mode?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>How many log files do you want to keep archived?</source>