Keep the calendar's day names in English (#6988)

The calendar grid's header row and the week-start toggle label were the only
text in the shell that followed the system locale, so a German desktop drew
MO DI MI over an interface that is English everywhere else. Nothing chose that;
they were the only two places reading day names off Qt.locale().

Take them from en_US instead. Where the week starts still follows the locale:
that is a regional convention rather than a translation, and it stays
overridable through weekStartDay.

Dropping the trailing-period strip with it, since that existed only for the
locales this no longer renders.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
David Heinemeier Hansson
2026-08-15 17:21:26 +02:00
committed by GitHub
co-authored by Claude Opus 5
parent ff4e92e63b
commit 25bee1d2a3
+7 -4
View File
@@ -64,7 +64,11 @@ Panel {
// convention. Clicking the grid's "W" heading writes the choice back to // convention. Clicking the grid's "W" heading writes the choice back to
// shell.json. // shell.json.
readonly property int weekStart: Model.normalizedWeekStart(setting("weekStartDay", null), Qt.locale().firstDayOfWeek) readonly property int weekStart: Model.normalizedWeekStart(setting("weekStartDay", null), Qt.locale().firstDayOfWeek)
readonly property string nextWeekStartLabel: Qt.locale().dayName(Model.toggledWeekStart(weekStart), Locale.LongFormat) // The interface is English throughout, so day names are not taken from the
// system locale. Where the week starts still is: that is a regional
// convention rather than a translation, and it stays overridable above.
readonly property var labelLocale: Qt.locale("en_US")
readonly property string nextWeekStartLabel: labelLocale.dayName(Model.toggledWeekStart(weekStart), Locale.LongFormat)
readonly property var weekdays: Model.weekdayOrder(weekStart) readonly property var weekdays: Model.weekdayOrder(weekStart)
readonly property var weeks: Model.monthGrid(viewYear, viewMonth, weekStart, todayKey) readonly property var weeks: Model.monthGrid(viewYear, viewMonth, weekStart, todayKey)
@@ -213,10 +217,9 @@ Panel {
setWeekStart(Model.toggledWeekStart(root.weekStart)) setWeekStart(Model.toggledWeekStart(root.weekStart))
} }
// Locale short day names, trimmed of the trailing period some locales // English short day names, matching the rest of the interface.
// carry ("man." -> "MAN") so the header row stays a clean band of caps.
function weekdayLabel(weekday) { function weekdayLabel(weekday) {
return String(Qt.locale().dayName(weekday, Locale.ShortFormat)).replace(/\.$/, "").toUpperCase() return String(labelLocale.dayName(weekday, Locale.ShortFormat)).toUpperCase()
} }
SystemClock { SystemClock {