feat(i18n): add i18n infrastructure, regression guard, and complete English locale#1101
Open
panoskava wants to merge 3 commits into
Open
feat(i18n): add i18n infrastructure, regression guard, and complete English locale#1101panoskava wants to merge 3 commits into
panoskava wants to merge 3 commits into
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces the foundational i18n infrastructure and completes the English locale file.
Infrastructure
src/lib/i18n.ts-- lightweightgetI18n()helper for non-React modules (Zustand stores, sync utilities) with locale caching and zh fallbackscripts/check-i18n.js-- regression guard that scanssrc/for hardcoded Chinese strings (exits 1 on violations)scripts/audit-locales.js-- verifies every key inmessages/zh.jsonexists in all other locale fileslint:i18nandaudit:localesnpm scripts topackage.jsonEnglish Locale Completion
messages/en.json:record.mark.note.confirm/cancel/removeThinkingrecord.chat.empty.quickPromptsmessages/en.jsonTest Plan
node scripts/check-i18n.jsruns and reports current violations (pre-existing, not introduced by this PR)node scripts/audit-locales.jsconfirmsen.jsonhas all 2117 keysgetI18n()helper loads messages correctly with zh fallbackNotes
ja.json,pt-BR.json, andzh-TW.jsonmissing keys reported byaudit-locales.jsare pre-existing from other features and not introduced by this PR.check-i18n.jsare also pre-existing in the codebase and serve as the baseline for future regression prevention.