feat: save locale in qt settings and switch to it on load
This commit is contained in:
parent
489ad7052f
commit
5268484114
|
@ -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
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
19
ui/main.qml
19
ui/main.qml
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue