Skip to content

Localize clock bar weekday/month names - #7173

Closed
dr-moreira wants to merge 0 commit into
omacom:quattrofrom
dr-moreira:clock-localize-day-names
Closed

dr-moreira wants to merge 0 commit into
omacom:quattrofrom
dr-moreira:clock-localize-day-names

Conversation

@dr-moreira

Copy link
Copy Markdown

Summary

  • omarchy.clock's bar label formats dates with Qt.formatDateTime(date, format), but that QML function always spells out day/month names (dddd, MMMM, ...) in English, regardless of the system locale — a known Qt quirk where format-string tokens ignore QLocale.
  • Switch to Qt.locale().toString(date, format), the locale-aware equivalent, so the bar clock shows day/month names in the user's configured locale (e.g. "domingo" instead of "Sunday" under pt_BR.UTF-8).
  • The calendar panel (Panel.qml) already does the right thing via Qt.locale().dayName(...); this brings the bar label in line with it.

Test plan

  • bash test/shell.d/clock-test.sh passes
  • Verified locale behavior directly with qml6: Qt.formatDateTime printed Sunday while Qt.locale().toString printed domingo under LANG=pt_BR.UTF-8
  • Confirmed on a running Omarchy shell (via a cloned omarchy.clock plugin) that the bar now shows the weekday name in Portuguese

@omarchybot

Copy link
Copy Markdown
Collaborator

Thanks for this, @dr-moreira. I reviewed it at 8741b90 and ran it on a disposable Omarchy worker. The change does what it says, but it reverses a decision that is already on quattro, so it is waiting on the maintainer rather than being fixed up here.

What ran. I loaded the real clock BarWidget.qml in quickshell under pt_BR.UTF-8, ru_RU.UTF-8 and en_US.UTF-8, with the base, this head, and this head with the change reverted. On base and on the revert the bar reads Sunday 14:05 in all three locales. On this head it reads domingo 14:05 and воскресенье 14:05, and en_US is unchanged. I did not run the full suite, because whether this should land is the open question and a green suite would not settle it.

Why it is waiting. #6988, merged on 15 August and already in this branch's base, made the shell English throughout on purpose. The comment at shell/plugins/panels/clock/Panel.qml:67 explains it, and the calendar takes its day names from Qt.locale("en_US") (labelLocale, line 70). Only the week start follows the locale, because that is a regional convention and not a translation. That PR's description names the bar clock and the month headings as already English, and it closed #6941, which localized the bar clock the same way this does. The description here says the panel already uses Qt.locale().dayName(...), but at this branch's base it does not. With this change the bar and the month headings would be localized while the weekday row and the week-start label stay English: the mixed interface #6988 removed.

If localization is wanted after all, a few things need handling first:

  • The MMMM yyyy heading at Panel.qml:716 uses the genitive form in Slavic locales, so Russian shows СЕНТЯБРЯ 2026 where СЕНТЯБРЬ 2026 is correct (Polish is the same: STYCZNIA rather than STYCZEŃ). A heading on its own wants standaloneMonthName().
  • MMMM d at line 315 keeps the English word order (setembro 27).
  • The weather panel's day names (shell/plugins/panels/weather/Panel.qml:309) would stay English.

Second opinion. Codex at medium effort reviewed the same diff and base history. It agreed that the English output is deliberate and not a bug, and that the description's claim about the panel does not hold at the base. It added the Polish case, and noted that Qt.formatDateTime also accepts a locale argument, so the new comment's "always" overstates it. It could read this review's working notes, so treat its agreement as not independent.

Nothing was pushed to your branch. Whether the shell should follow the system locale is the maintainer's call, and this is waiting on them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants