feat: save locale in qt settings and switch to it on load

This commit is contained in:
Jonathan Rainville 2020-07-16 18:04:47 -04:00 committed by Iuri Matias
parent 489ad7052f
commit 5268484114
2 changed files with 14 additions and 9 deletions

View File

@ -74,7 +74,7 @@ Item {
}
RowLayout {
property string currentLocale: "en" // TODO get from settings
property string currentLocale: appSettings.locale
id: languageSetting
anchors.top: compactModeSetting.bottom
anchors.topMargin: 20
@ -94,7 +94,7 @@ Item {
text: locale,
onClicked: function () {
profileModel.changeLocale(locale)
languageSetting.currentLocale = locale
appSettings.locale = locale
}
}
})

View File

@ -34,6 +34,10 @@ ApplicationWindow {
visible: true
Component.onCompleted: {
if (settings.locale !== "en") {
profileModel.changeLocale(settings.locale)
}
setX(Qt.application.screens[0].width / 2 - width / 2);
setY(Qt.application.screens[0].height / 2 - height / 2);
}
@ -57,13 +61,14 @@ ApplicationWindow {
}
Settings {
id: settings
property var chatSplitView
property var walletSplitView
property var profileSplitView
property bool displayChatImages: false
property bool compactMode
}
id: settings
property var chatSplitView
property var walletSplitView
property var profileSplitView
property bool displayChatImages: false
property bool compactMode
property string locale: "en"
}
SystemTrayIcon {
visible: true