You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(i18n): retire four hand-rolled zh/en branches (#2871, part 1)
Four surfaces picked their language with a hand-written `startsWith('zh')`
check instead of the locale packs. Only Chinese was ever handled, so the other
eight shipped languages silently fell back to English — and because the strings
were baked into the components, no translator could fix that.
- RecordTitleChip carried a private zh-CN/zh-TW dictionary behind a comment
claiming "components is i18n-free". It isn't: the package declares
@object-ui/i18n and its sibling containers.tsx already uses it. All four keys
already existed in ALL TEN packs, so this deletes ~35 lines and fixes ten
locales with zero new translations — on a component that renders on every
record detail page.
- EnvironmentListToolbar's three state-aware CTA labels move to a new
`environment.*` namespace. This surface already regressed once for the same
reason (#844), and was fixed then with inline {en,zh} pairs.
- StudioAiCopilot's dock title moves to the Studio catalog.
- StudioHomePage.relativeTime uses Intl.RelativeTimeFormat instead of five
ternaries. Better than adding ten keys: every locale, correct plural rules,
and "yesterday"/「昨天」 instead of "1d ago". Arabic gets its dual form
(«أسبوعين»), which a ternary cannot express.
New `environment.*` keys go into all ten packs, so this doesn't widen the gap
tracked by #2872 part (a).
EnvironmentListToolbar's tests now render inside a real I18nProvider pinned to
`en`. Without one `t()` returns the raw key, so the previous assertions on
literal English would have been asserting nothing — the tests failed the moment
the component started resolving properly, which is how I caught it.
Suites: components 311, app-shell environment+views 1539, i18n 121 — all green.
ESLint 0 errors; the one exhaustive-deps warning on StudioAiCopilot is
pre-existing (verified against a stashed baseline).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TubWYdWquVkS9dj733sDmC
0 commit comments