fix(i18n): complete zh-CN onboarding translations#1981
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis PR adds Simplified Chinese (zh-CN) translations and a test that verifies zh-CN includes all English translation keys. The zh-CN file adds settings alert strings, extensive onboarding content (runtime choice, API keys, custom onboarding steps for inference, voice, OAuth, search, memory), and a beta feedback string; a test asserts no missing keys. ChangesChinese Translation Updates
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
app/src/lib/i18n/__tests__/I18nContext.test.tsx (1)
49-51: ⚡ Quick winStrengthen drift guard to catch empty translations, not just missing keys.
This currently passes when a zh-CN key exists but is an empty string. Consider asserting both presence and non-empty values.
Proposed improvement
- const missingKeys = Object.keys(en).filter(key => !(key in zhCN)); - - expect(missingKeys).toEqual([]); + const missingKeys = Object.keys(en).filter( + key => !Object.hasOwn(zhCN, key), + ); + const emptyKeys = Object.keys(en).filter(key => { + const value = zhCN[key as keyof typeof zhCN]; + return typeof value !== 'string' || value.trim().length === 0; + }); + + expect(missingKeys).toEqual([]); + expect(emptyKeys).toEqual([]);🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@app/src/lib/i18n/__tests__/I18nContext.test.tsx` around lines 49 - 51, The test currently only checks that keys in `en` exist in `zhCN` (via `missingKeys`), but misses cases where `zhCN` has an empty string; update the assertion to also detect empty/blank translations by changing the filter to require that `zhCN[key]` is a non-empty string (e.g., check `key in zhCN && typeof zhCN[key] === 'string' && zhCN[key].trim() !== ''`) or produce a separate `emptyKeys` array for keys whose `zhCN` value is falsy/blank, and assert both `missingKeys` and `emptyKeys` are empty in the `I18nContext.test.tsx` test.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@app/src/lib/i18n/__tests__/I18nContext.test.tsx`:
- Around line 49-51: The test currently only checks that keys in `en` exist in
`zhCN` (via `missingKeys`), but misses cases where `zhCN` has an empty string;
update the assertion to also detect empty/blank translations by changing the
filter to require that `zhCN[key]` is a non-empty string (e.g., check `key in
zhCN && typeof zhCN[key] === 'string' && zhCN[key].trim() !== ''`) or produce a
separate `emptyKeys` array for keys whose `zhCN` value is falsy/blank, and
assert both `missingKeys` and `emptyKeys` are empty in the
`I18nContext.test.tsx` test.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 0724e5e2-197f-4bd3-941a-cdc858cdaf2a
📒 Files selected for processing (2)
app/src/lib/i18n/__tests__/I18nContext.test.tsxapp/src/lib/i18n/zh-CN.ts
There was a problem hiding this comment.
Pull request overview
Completes Simplified Chinese i18n coverage for onboarding/runtime-choice related copy and adds a regression guard intended to keep zh-CN aligned with English translation keys.
Changes:
- Adds missing zh-CN translations for settings alerts, runtime selection, API key setup, custom onboarding, and beta feedback.
- Adds a Vitest key-completeness check comparing zh-CN against English.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
app/src/lib/i18n/zh-CN.ts |
Adds Simplified Chinese translations for previously missing onboarding/settings keys. |
app/src/lib/i18n/__tests__/I18nContext.test.tsx |
Adds a regression test for zh-CN translation key completeness. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Problem
zh-CN.tswas missing 69 keys that exist inen.ts.Solution
I18nContext.test.tsxso future English keys must be added to zh-CN deliberately.Submission Checklist
## Related— N/A: no feature matrix IDs affected.docs/RELEASE-MANUAL-SMOKE.md) — N/A: translation copy only, no release smoke surface changed.Closes #NNNin the## RelatedsectionImpact
Related
AI Authored PR Metadata (required for Codex/Linear PRs)
Linear Issue
Commit & Branch
zh-cn-i18n-completeness22be22afValidation Run
pnpm --filter openhuman-app format:checkpnpm typecheckpnpm debug unit src/lib/i18n/__tests__/I18nContext.test.tsxpnpm debug unit src/lib/i18n/__tests__/I18nContext.test.tsxpnpm lint(exit 0; existing warning set remains)pnpm --dir app run lint:commands-tokenspnpm rust:check(exit 0; existing warning set remains)pnpm --filter openhuman-app format:checkandpnpm rust:checkValidation Blocked
command:N/Aerror:N/Aimpact:N/ABehavior Changes
Parity Contract
en.ts; no routing or dispatch logic changed.Duplicate / Superseded PR Handling
Monking-21:zh-cn-i18n-completeness.Summary by CodeRabbit
New Features
Tests