fix: disable dynamic translations on linux

This commit is contained in:
Richard Ramos 2021-07-28 13:54:40 -04:00 committed by Iuri Matias
parent 4ba08f02a5
commit 481184df25
4 changed files with 30 additions and 5 deletions

View File

@ -141,9 +141,9 @@ proc mainProc() =
proc changeLanguage(locale: string) =
if (locale == currentLanguageCode):
return
currentLanguageCode = locale
engine.setTranslationPackage(joinPath(i18nPath, fmt"qml_{locale}.qm"))
let shouldRetranslate = not defined(linux)
engine.setTranslationPackage(joinPath(i18nPath, fmt"qml_{locale}.qm"), shouldRetranslate)
var profile = profile.newController(status, changeLanguage)
defer: profile.delete()

View File

@ -22,6 +22,26 @@ ModalPopup {
id: languageGroup
}
ConfirmationDialog {
id: languageChangeConfirmationDialog
property string newLocale
title: qsTr("Change language")
confirmationText: qsTr("Display language has been changed. You must restart the application for changes to take effect.")
showCancelButton: true
confirmButtonLabel: qsTr("Close the app now")
cancelButtonLabel: qsTr("I'll do that later")
onConfirmButtonClicked: {
console.log("NEW LOCALE?", newLocale)
profileModel.changeLocale(newLocale)
Qt.quit();
}
onCancelButtonClicked: {
languageChangeConfirmationDialog.close()
popup.close()
}
}
ScrollView {
width: parent.width
anchors.top: parent.top
@ -49,8 +69,13 @@ ModalPopup {
checked: globalSettings.locale === modelData.locale
onRadioCheckedChanged: {
if (checked && globalSettings.locale !== modelData.locale) {
profileModel.changeLocale(modelData.locale)
globalSettings.locale = modelData.locale
if (utilsModel.getOs() === Constants.linux) {
languageChangeConfirmationDialog.newLocale = modelData.locale
languageChangeConfirmationDialog.open()
} else {
profileModel.changeLocale(modelData.locale)
}
}
}
}

2
vendor/DOtherSide vendored

@ -1 +1 @@
Subproject commit a838753904615610667e704efec5864e0d27e7c2
Subproject commit 702dcaa0d2f8c0603fd1dc1e822f7c447cd81157

2
vendor/nimqml vendored

@ -1 +1 @@
Subproject commit 8ca765ca11a9fde6a43d60289afcea312d3e6ed8
Subproject commit 53d89149f3cafbe7d7b507bdfcba2544ff091ede