Skip to content

fix(i18n): render relative times in the app language, not the OS locale - #6871

Merged
Rishet11 merged 2 commits into
OrchestratorInc:mainfrom
axisrow:upstream/home-locale-times
Oct 30, 2026
Merged

Rishet11 merged 2 commits into
OrchestratorInc:mainfrom
axisrow:upstream/home-locale-times

Conversation

@axisrow

@axisrow axisrow commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

Relative times on Home (and in session-link preview cards) were rendered with new Intl.RelativeTimeFormat(undefined, …), which picks the OS locale instead of the application language — an English UI on a non-English OS showed mixed-language timestamps.

Fixes #6680

Change

  • HomePage: relativeProjectTime reuses the app's formatTimeCompact (already localized through appI18n, terse "5m ago" style used across Sidebar / NotificationCenter / ArtifactsView), keeping the empty-timestamp fallback.
  • SessionLinkPreviewCard: the local Intl.RelativeTimeFormat collapses into format("shell.updatedAt", { time: formatTimeCompact(timestamp) }).

Verification

  • SessionLinkPreviewCard.test.tsx — renders under appI18n.changeLanguage("zh-CN") and asserts catalog wording (same pattern as SessionsBoard.test.tsx); green with LC_ALL=en_US.UTF-8 on en-US machines.
  • Visual check in headless Chromium against dev:web with a ru-RU browser locale (dark scheme): Home shows compact "5m ago"-style times in the app language with no OS-locale leakage.

🤖 Generated with Claude Code

Intl.RelativeTimeFormat(undefined) picked up the environment locale, so
Home rows and session link preview cards leaked the OS language into an
English UI and disagreed with the board, which formats through the i18n
catalogs. Both call sites now reuse formatTimeCompact from
renderer/lib/format-time, the same localized wrapper as the rest of the
app; Home rows move to the terse "5m ago" house style.

Refs OrchestratorInc#6680

Co-Authored-By: Claude Code <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

🏆 Review leaderboard

Oct 10–17, 2026 · UTC

Rank Reviewer PRs reviewed Review rounds PR comments
🥇 @axisrow @axisrow 233 315 3
🥈 @nikhilachale @nikhilachale 25 50 10
🥉 @ronishrohan @ronishrohan 24 32 3
4 @illegalcall @illegalcall 21 60 11
5 @Prasad-D-Ware @Prasad-D-Ware 17 29 3
6 @codebanditssss @codebanditssss 8 9 0
7 @Vaibhaav-Tiwari @Vaibhaav-Tiwari 7 10 4
8 @mohakchakraborty2004 @mohakchakraborty2004 6 6 0
9 @Rishet11 @Rishet11 5 23 25
10 @Annieeeee11 @Annieeeee11 5 11 1

Ranked by distinct external PRs reviewed, then review rounds, then PR comments. Self-activity and bot activity are excluded.

Show 8 more reviewers
Rank Reviewer PRs reviewed Review rounds PR comments
11 @somewherelostt @somewherelostt 5 9 2
12 @neversettle17-101 @neversettle17-101 4 6 0
13 @Pritom14 @Pritom14 4 4 9
14 @harshitsinghbhandari @harshitsinghbhandari 3 5 0
15 @wesleymatosdev @wesleymatosdev 2 8 2
16 @LaibaFirdouse @LaibaFirdouse 2 3 0
17 @whoisasx @whoisasx 2 2 0
18 @ApexYash11 @ApexYash11 1 1 1

@OrcInc OrcInc added bug Something isn't working comp/desktop Electron main process and React renderer. labels Oct 17, 2026
@OrcInc OrcInc added this to the Desktop & UI milestone Oct 17, 2026

@Rishet11 Rishet11 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Typecheck and the SessionLinkPreviewCard test pass on this merged with current main. ArtifactHistory.tsx still formats with the OS locale, worth a follow-up.

@Rishet11
Rishet11 merged commit ccfa051 into OrchestratorInc:main Oct 30, 2026
12 checks passed
@Rishet11

Copy link
Copy Markdown
Collaborator

Checked on main after merge (ccfa051) in the dev app, AO set to Chinese, macOS on English. Both times now follow the app language.

Home:
home-zh

Session link card:
card-zh

English for comparison:
home-en

The sidebar session time ("now") and ArtifactHistory still use the system locale, follow-ups.

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

Labels

bug Something isn't working comp/desktop Electron main process and React renderer.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Home relative times follow the OS locale instead of the app language (mixed-language UI)

3 participants