Locale: factorized usage in I18n.

This commit is contained in:
ItsLemmy
2025-10-30 17:43:35 -04:00
parent e1d39f3bbc
commit 29ad654a58
9 changed files with 19 additions and 28 deletions
+3 -5
View File
@@ -18,8 +18,6 @@ Loader {
id: lockScreen
active: false
property var locale: I18n.langCode ? Qt.locale(I18n.langCode) : Qt.locale()
// Track if triggered via deprecated IPC call
property bool triggeredViaDeprecatedCall: false
@@ -344,7 +342,7 @@ Loader {
// Date below
NText {
text: {
var lang = locale.name.split("_")[0]
var lang = I18n.locale.name.split("_")[0]
var formats = {
"de": "dddd, d. MMMM",
"es": "dddd, d 'de' MMMM",
@@ -352,7 +350,7 @@ Loader {
"pt": "dddd, d 'de' MMMM",
"zh": "yyyy年M月d日 dddd"
}
return locale.toString(Time.date, formats[lang] || "dddd, MMMM d")
return I18n.locale.toString(Time.date, formats[lang] || "dddd, MMMM d")
}
pointSize: Style.fontSizeXL
font.weight: Font.Medium
@@ -768,7 +766,7 @@ Loader {
NText {
text: {
var weatherDate = new Date(LocationService.data.weather.daily.time[index].replace(/-/g, "/"))
return Qt.locale().toString(weatherDate, "ddd")
return I18n.locale.toString(weatherDate, "ddd")
}
pointSize: Style.fontSizeM
color: Color.mOnSurfaceVariant