Localize post date and calendar month formatting #100

Closed
opened 2026-07-22 13:31:07 +00:00 by hugo · 1 comment
Owner

In crates/bds-ui/src/views/sidebar.rs, format_post_date uses chrono's unlocalized %b %d, %Y and month_abbr returns hardcoded English month abbreviations, violating the project i18n rule ("no untranslated string constants") and the PostDateFormat spec in specs/sidebar_views.allium (lines ~73-89), which requires toLocaleDateString(locale, month: short, day: numeric, year: numeric) via the LocaleMapping (en-US/de-DE/fr-FR/it-IT/es-ES). The workspace chrono dependency already has the unstable-locales feature enabled and there is a locale-mapping precedent in crates/bds-ui/src/i18n/relative_date.rs (format_locale + format_localized). Make format_post_date and the calendar month labels locale-aware, add unit tests, and note that cargo test --workspace must run on the macOS dev machine (no Rust toolchain on this Windows box).

In crates/bds-ui/src/views/sidebar.rs, format_post_date uses chrono's unlocalized %b %d, %Y and month_abbr returns hardcoded English month abbreviations, violating the project i18n rule ("no untranslated string constants") and the PostDateFormat spec in specs/sidebar_views.allium (lines ~73-89), which requires toLocaleDateString(locale, month: short, day: numeric, year: numeric) via the LocaleMapping (en-US/de-DE/fr-FR/it-IT/es-ES). The workspace chrono dependency already has the unstable-locales feature enabled and there is a locale-mapping precedent in crates/bds-ui/src/i18n/relative_date.rs (format_locale + format_localized). Make format_post_date and the calendar month labels locale-aware, add unit tests, and note that cargo test --workspace must run on the macOS dev machine (no Rust toolchain on this Windows box).
hugo added the bug label 2026-07-22 13:31:07 +00:00
Author
Owner

Implemented in 0d44c21. Sidebar post dates now use the selected UI locale with the Allium/Intl month-day-year ordering and punctuation for en-US, de-DE, fr-FR, it-IT, and es-ES. Calendar archive month labels now use the same shared chrono locale mapping instead of hardcoded English names. Added exact unit coverage for all five post-date locales and representative localized month abbreviations, and updated the README. Neutral review matched the issue, bDS2 intent, and specs/sidebar_views.allium; outputs were also cross-checked against Intl.DateTimeFormat. Verification passed: cargo test --workspace, cargo build --workspace, strict cargo clippy, cargo machete, cargo fmt --check, allium check specs, and visual QA of the exact release macOS bundle in German (including Mär in the expanded calendar).

Implemented in 0d44c21. Sidebar post dates now use the selected UI locale with the Allium/Intl month-day-year ordering and punctuation for en-US, de-DE, fr-FR, it-IT, and es-ES. Calendar archive month labels now use the same shared chrono locale mapping instead of hardcoded English names. Added exact unit coverage for all five post-date locales and representative localized month abbreviations, and updated the README. Neutral review matched the issue, bDS2 intent, and specs/sidebar_views.allium; outputs were also cross-checked against Intl.DateTimeFormat. Verification passed: cargo test --workspace, cargo build --workspace, strict cargo clippy, cargo machete, cargo fmt --check, allium check specs, and visual QA of the exact release macOS bundle in German (including Mär in the expanded calendar).
hugo closed this issue 2026-07-22 18:29:21 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: hugo/RuDS#100