Skip to content

feat(control-plane): add i18n framework#1729

Closed
XIYBHK wants to merge 2 commits into
vectorize-io:mainfrom
XIYBHK:control-plane-i18n
Closed

feat(control-plane): add i18n framework#1729
XIYBHK wants to merge 2 commits into
vectorize-io:mainfrom
XIYBHK:control-plane-i18n

Conversation

@XIYBHK
Copy link
Copy Markdown
Contributor

@XIYBHK XIYBHK commented May 25, 2026

Summary

  • Add an i18next/react-i18next localization framework for the control plane.
  • Add English and Simplified Chinese resource files plus locale resolution and persistence.
  • Add a language selector and initial localized coverage for the app shell, dashboard, login, bank overview, recall, reflect, and entities views.

Notes

  • This is an initial framework and coverage pass, not a complete translation of every control-plane string.
  • Developer/API terms such as GitHub, JSON, API, IDs, event names, and raw data values are intentionally preserved where appropriate.
  • Locale preferences are applied after hydration to avoid server/client text mismatches.

Closes #1660.

Verification

  • sc --noEmit in hindsight-control-plane
  • Targeted ESLint check for changed i18n/control-plane files (0 errors; existing warnings remain in touched legacy views)

ext build in hindsight-control-plane

  • Browser check for Chinese rendering on login, recall, and reflect with 0 new hydration errors

Add i18next/react-i18next setup, a locale provider, language selector, English and Simplified Chinese resource files, and initial localized coverage for the control plane shell, login, recall, reflect, and entities views.
@XIYBHK XIYBHK mentioned this pull request May 25, 2026
1 task
- derive the initial locale from cookie and Accept-Language in the root layout

- initialize a per-provider i18next instance from the server-provided locale

- persist language changes in a cookie and localStorage

- localize shell relative time and top-level bank actions
@XIYBHK
Copy link
Copy Markdown
Contributor Author

XIYBHK commented May 25, 2026

Update: pushed a follow-up hydration fix. The root layout now resolves the initial locale from the locale cookie or Accept-Language, passes it to html lang and I18nProvider, and the provider creates a per-instance i18next setup instead of doing a delayed client-side switch. Verified tsc --noEmit, targeted ESLint, next build, and browser reloads in zh-CN/en/zh-CN with 0 fresh hydration mismatch logs.

@MapleEve
Copy link
Copy Markdown
Contributor

Working on it

@MapleEve
Copy link
Copy Markdown
Contributor

MapleEve commented May 26, 2026

I pushed a stacked PR against XIYBHK:control-plane-i18n so this can be merged into this draft PR instead of competing with it: XIYBHK#1

Scope covered there:

  • expanded control-plane i18n key coverage across UI/components and API errors
  • added zh-TW (正體中文(臺灣))
  • added canonical yue-Hant (粵語(繁體)) for general/world Cantonese in Traditional script, with yue-Hant-HK/yue-HK/yue aliases kept for compatibility
  • localized API error response text through i18n resources via errorKey, instead of hardcoding Chinese responses
  • kept all locale schemas aligned: en, zh-CN, zh-TW, and yue-Hant each have 1011 leaf keys; missing/extra keys are 0
  • covered 78 API errorKey values in all four locales

Validation note: git diff --check and the targeted i18n coverage checks passed. tsc --noEmit still reports existing non-i18n issues around the observations route implicit any and missing @vectorize-io/hindsight-client type resolution.

@nicoloboschi
Copy link
Copy Markdown
Collaborator

superseded by #1775

feel free to add/improve more languages @XIYBHK @MapleEve , thanks

@MapleEve
Copy link
Copy Markdown
Contributor

Update: #1729 is now superseded by the official i18n PR #1775, which has been merged into main.

I rebased/ported the Chinese locale follow-up onto the official next-intl message catalog structure and opened a new upstream PR here: #1784

That PR adds zh-CN, zh-TW (正體中文(臺灣)), and canonical yue-Hant (粵語(繁體)) on top of the official 8-locale implementation, and also localizes API error payloads through message keys without exposing errorKey in the response body.

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.

Control Pane Localizations

3 participants