mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-08-11 16:50:16 +00:00
Locale: fixed all Qt.locale calls to respect the user selected locale.
This commit is contained in:
@@ -10,6 +10,8 @@ ColumnLayout {
|
||||
spacing: Style.marginM
|
||||
width: 700
|
||||
|
||||
property var locale: I18n.langCode ? Qt.locale(I18n.langCode) : Qt.locale()
|
||||
|
||||
// Properties to receive data from parent
|
||||
property var widgetData: null
|
||||
property var widgetMetadata: null
|
||||
@@ -200,7 +202,7 @@ ColumnLayout {
|
||||
// Horizontal
|
||||
Repeater {
|
||||
Layout.topMargin: Style.marginM
|
||||
model: Qt.locale().toString(now, valueFormatHorizontal.trim()).split("\\n")
|
||||
model: locale.toString(now, valueFormatHorizontal.trim()).split("\\n")
|
||||
delegate: NText {
|
||||
visible: text !== ""
|
||||
text: modelData
|
||||
@@ -231,7 +233,7 @@ ColumnLayout {
|
||||
|
||||
Repeater {
|
||||
Layout.topMargin: Style.marginM
|
||||
model: Qt.locale().toString(now, valueFormatVertical.trim()).split(" ")
|
||||
model: locale.toString(now, valueFormatVertical.trim()).split(" ")
|
||||
delegate: NText {
|
||||
visible: text !== ""
|
||||
text: modelData
|
||||
|
||||
@@ -9,6 +9,8 @@ ColumnLayout {
|
||||
id: root
|
||||
spacing: Style.marginL
|
||||
|
||||
property var locale: I18n.langCode ? Qt.locale(I18n.langCode) : Qt.locale()
|
||||
|
||||
NHeader {
|
||||
label: I18n.tr("settings.location.location.section.label")
|
||||
description: I18n.tr("settings.location.location.section.description")
|
||||
@@ -135,15 +137,15 @@ ColumnLayout {
|
||||
"name": I18n.tr("settings.location.date-time.first-day-of-week.automatic")
|
||||
}, {
|
||||
"key": "6",
|
||||
"name": Qt.locale().dayName(6, Locale.LongFormat)
|
||||
"name": locale.dayName(6, Locale.LongFormat)
|
||||
}, // Saturday
|
||||
{
|
||||
"key": "0",
|
||||
"name": Qt.locale().dayName(0, Locale.LongFormat)
|
||||
"name": locale.dayName(0, Locale.LongFormat)
|
||||
}, // Sunday
|
||||
{
|
||||
"key": "1",
|
||||
"name": Qt.locale().dayName(1, Locale.LongFormat)
|
||||
"name": locale.dayName(1, Locale.LongFormat)
|
||||
} // Monday
|
||||
]
|
||||
onSelected: key => Settings.data.location.firstDayOfWeek = parseInt(key)
|
||||
|
||||
Reference in New Issue
Block a user