fix(i18n): localize Timestamp relative formats - #5859
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
67763cd to
4257c1b
Compare
PR Analysis Report
Modified ComponentsTimestamp (@astryxdesign/core)
Bundle Size Summary
Accessibility AuditStatus: 1 accessibility violation(s) found — 1 serious. Timestamp - 1 issue(s)
Visual Regression12 added · 0 removed. View the report A repository maintainer can accept these exact frames: Generated by PR Enrichment workflow | View full report |
cixzhang
left a comment
There was a problem hiding this comment.
Thanks this is good. The provider-locale regression is fixed across relative, compact, and auto modes. Please resolve the generated RTL-audit list conflict before merge.
[Reviewed by Robohands]
|
/accept-visual 33568304679/1 screens look good, test is essentially plain default text |
|
Visual changes accepted for |
cixzhang
left a comment
There was a problem hiding this comment.
Thanks, this is good. Non-English providers now get native relative timestamps across relative, compact, and auto modes, and the merge resolves the RTL-audit conflict.
[Reviewed by Robohands]



Problem
Timestamp's absolute formats follow
InternationalizationProvider, butrelative,relative_short, and the relative branch ofautostill assemble English phrases manually. A French provider therefore renders2 hours ago,now, andyesterdayin English.Change
Intl.RelativeTimeFormat.longstyle forrelative/autoandnarrowforrelative_short.nowandyesterdayidioms, while compact output stays numeric.Native formatting also replaces the English-only
in a few secondsspecial case with the locale's exact seconds form, such asin 31 seconds.Intl.RelativeTimeFormatformats a signed quantity and unit; it has no calendar option and does not convert or inspect calendar dates. Gregorian enforcement therefore does not apply here. The raw-Intl lint did catch direct construction inTimestamp.tsx; construction now lives in a narrowly approved pure helper that requires the provider locale.Visual evidence
The permanent English Storybook story covers every past and future transition point. French below is a temporary provider override used only for evidence.
Before — French provider ignored
After — English
After — French
Fixes #5074.
Test plan
2 hours ago,2h ago, andnow) where French was expected.pnpm exec vitest run --project ui packages/core/src/Timestamp/Timestamp.test.tsx— 92 passed.pnpm exec vitest run --project node internal/eslint-plugin-astryx/no-raw-intl-locale.test.mjs— 100 passed.pnpm rtl:audit --filter Timestamp— verified N/A with 0 coverage gaps; Timestamp has no directional visual or behavior.pnpm lint:strict— passed with existing warnings only.pnpm -F @astryxdesign/core build— passed.