Skip to content

feat(i18n): add i18n infrastructure, regression guard, and complete English locale#1101

Open
panoskava wants to merge 3 commits into
codexu:devfrom
panoskava:feat/en-json-completeness
Open

feat(i18n): add i18n infrastructure, regression guard, and complete English locale#1101
panoskava wants to merge 3 commits into
codexu:devfrom
panoskava:feat/en-json-completeness

Conversation

@panoskava

Copy link
Copy Markdown

Summary

This PR introduces the foundational i18n infrastructure and completes the English locale file.

Infrastructure

  • Add src/lib/i18n.ts -- lightweight getI18n() helper for non-React modules (Zustand stores, sync utilities) with locale caching and zh fallback
  • Add scripts/check-i18n.js -- regression guard that scans src/ for hardcoded Chinese strings (exits 1 on violations)
  • Add scripts/audit-locales.js -- verifies every key in messages/zh.json exists in all other locale files
  • Add lint:i18n and audit:locales npm scripts to package.json

English Locale Completion

  • Translate remaining Chinese strings in messages/en.json:
    • record.mark.note.confirm/cancel/removeThinking
    • record.chat.empty.quickPrompts
  • Achieves zero Chinese characters in messages/en.json

Test Plan

  • node scripts/check-i18n.js runs and reports current violations (pre-existing, not introduced by this PR)
  • node scripts/audit-locales.js confirms en.json has all 2117 keys
  • getI18n() helper loads messages correctly with zh fallback
  • No Chinese characters remain in `messages/en.json"

Notes

  • The ja.json, pt-BR.json, and zh-TW.json missing keys reported by audit-locales.js are pre-existing from other features and not introduced by this PR.
  • The ~200 hardcoded Chinese string violations reported by check-i18n.js are also pre-existing in the codebase and serve as the baseline for future regression prevention.

panoskava added 3 commits May 29, 2026 20:22
…audit scripts

- src/lib/i18n.ts: lightweight t() helper for non-React modules
- scripts/check-i18n.js: scans src/ for hardcoded Chinese strings
- scripts/audit-locales.js: verifies JSON key parity across all locales
- package.json: registers lint:i18n and audit:locales scripts
- Translate record.mark.note.confirm/cancel/removeThinking to English
- Translate record.chat.empty.quickPrompts to English
- Achieves zero Chinese characters in en.json
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