Skip to content

feat(i18n): localize shared UI components + init i18n in tests - #128

Merged
os-zhuang merged 1 commit into
mainfrom
feat/i18n-shared-components
Jun 11, 2026
Merged

feat(i18n): localize shared UI components + init i18n in tests#128
os-zhuang merged 1 commit into
mainfrom
feat/i18n-shared-components

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

i18n P2 — shared components

The reusable components whose button / empty-state copy was still hardcoded English.

Components wired

  • DatePicker — Clear / Today / Done
  • MultiSelect — Done
  • UndoSnackbar — Undo (text + a11y)
  • Reasoning — header
  • SwipeableRow + BatchActionBar — Edit / Delete
  • QueryBuilder — Clear / Add filter
  • SaveViewDialog — title / name / placeholder / visibility / private / shared / save
  • FileField — Gallery / Camera / File / "Uploading…" / upload-failed toast / attached-file

Keys

New: common.{clear,today,undo}, ai.reasoning, fields.{gallery,camera,file,uploading,uploadFailed,attachedFile}, and a new views namespace. Reuses common.{edit,delete,done,saving} and filter.addFilter where they fit.

Test infra

jest.setup now initializes ~/lib/i18n, so components rendered in isolation get real strings from t() instead of raw keys — previously each test relied on its import chain happening to pull in i18n (which broke the Reasoning + batch snapshot tests once those components started using t()).

All three locales at full key parity; tsc + lint clean, full suite 1337 passing.

🤖 Generated with Claude Code

P2 of the i18n sweep — the reusable components whose button/empty-state copy
was still hardcoded English:

- DatePicker (Clear/Today/Done), MultiSelect (Done), UndoSnackbar (Undo),
  Reasoning (header), SwipeableRow + BatchActionBar (Edit/Delete),
  QueryBuilder (Clear/Add filter), SaveViewDialog (title/name/visibility/
  private/shared/save), FileField (Gallery/Camera/File/uploading/upload-failed/
  attached-file).
- New keys: common.{clear,today,undo}, ai.reasoning, fields.{gallery,camera,
  file,uploading,uploadFailed,attachedFile}, and a new `views` namespace;
  reuses common.{edit,delete,done,saving} and filter.addFilter where they fit.

jest.setup now initializes ~/lib/i18n so components rendered in isolation get
real strings from t() instead of raw keys (previously each test relied on its
import chain happening to pull i18n in). All three locales at full key parity;
tsc + lint clean, full suite 1337 passing.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@os-zhuang
os-zhuang merged commit 19f3569 into main Jun 11, 2026
@os-zhuang
os-zhuang deleted the feat/i18n-shared-components branch June 11, 2026 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant