mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-05 05:12:05 -04:00
feat: add setting to change and hotreload locale (#1817)
* feat: add setting to change and hotreload locale * fix: typo in component id * feat: add persistent locale setting * feat: wrap useLocale in a settings set hook, enable locale hotreload when editing settings file * chore: update translation and settings file * feat: enable fuzzy search in locale setting * fix: regenerate translations with official plugins cloned * fix: revert back to system's locale for displaying certain time formats
This commit is contained in:
@@ -179,7 +179,7 @@ Rectangle {
|
||||
StyledText {
|
||||
width: parent.width - 56
|
||||
height: 28
|
||||
text: calendarGrid.displayDate.toLocaleDateString(Qt.locale(), "MMMM yyyy")
|
||||
text: calendarGrid.displayDate.toLocaleDateString(I18n.locale(), "MMMM yyyy")
|
||||
font.pixelSize: Theme.fontSizeMedium
|
||||
color: Theme.surfaceText
|
||||
font.weight: Font.Medium
|
||||
@@ -223,11 +223,10 @@ Rectangle {
|
||||
Repeater {
|
||||
model: {
|
||||
const days = [];
|
||||
const loc = Qt.locale();
|
||||
const qtFirst = loc.firstDayOfWeek;
|
||||
const qtFirst = Qt.locale().firstDayOfWeek;
|
||||
for (let i = 0; i < 7; ++i) {
|
||||
const qtDay = ((qtFirst - 1 + i) % 7) + 1;
|
||||
days.push(loc.dayName(qtDay, Locale.ShortFormat));
|
||||
days.push(I18n.locale().dayName(qtDay, Locale.ShortFormat));
|
||||
}
|
||||
return days;
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ Card {
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: systemClock?.date?.toLocaleDateString(Qt.locale(), "MMM dd")
|
||||
text: systemClock?.date?.toLocaleDateString(I18n.locale(), "MMM dd")
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.7)
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
Reference in New Issue
Block a user