Repository navigation
Show day and month names in the locale's language - #19
Open
piotrkowski wants to merge 2 commits into
Open
piotrkowski wants to merge 2 commits into
piotrkowski wants to merge 2 commits into
Conversation
piotrkowski
force-pushed
the
feat/locale-names
branch
from
October 11, 2026 18:39
97a9ef3 to
1192270
Compare
The week always started on Sunday, a constant in date_util.rs, which is not where most of the world starts it. It now starts on the locale's first weekday. Neither GLib nor GTK exposes that, so `locale.rs` asks glibc's `nl_langinfo` for `_NL_TIME_WEEK_1STDAY` and `_NL_TIME_FIRST_WEEKDAY`, the way GtkCalendar does, with no new dependency. Decoding the two values is a pure function in date_util.rs with its own tests; the FFI around it is a few lines. Startup records the result once, after GTK has called setlocale. Off glibc, or on a value the decoding doesn't recognise, the week keeps starting on Sunday. `week_start`, `week_dates` and `month_grid` follow it, and the weekday labels in month view and the year thumbnails rotate to match.
Weekday headers, month titles and the year view's month names came from chrono's `%a` and `%B`, which only know English. They now come from `glib::DateTime::format`, which follows LC_TIME, so there is still no new dependency. Month names use `%OB`, the form a month takes on its own, rather than `%B`, the form it takes inside a date: Polish "październik" over a month, not "października". Full dates — the day view's title, the week's range, tooltips and notifications — stay in English for now. They need each locale's order and case as well as its words, which is a change of its own.
piotrkowski
force-pushed
the
feat/locale-names
branch
from
October 11, 2026 19:01
1192270 to
cf36a88
Compare
This was referenced Oct 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #17. Builds on #18, so only the second commit is new here. Once #18 lands I'll rebase this onto master. It also touches the year view's month heading, which #15 moves, so whichever of the two lands second gets rebased as well.
Weekday headers, month titles and year-view month names now come from
glib::DateTime::format, which followsLC_TIME. There's no new dependency. Month titles use%OB, the standalone month name, e.g. Polish październik rather than października.Composite dates (day title, week range, tooltips, notifications) are unchanged. They also need locale-specific ordering and case, so I'll handle them separately.
pl_PL/de_DE/ru_RU:Checked with the four CI gates and
gui_leaks.