fix(auth): localize reset password confirmation - #4769
Conversation
Wrap reset confirmation page copy in frontend i18n calls and add matching locale entries so the page no longer mixes translated labels with hardcoded English copy.
|
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 (7)
✅ Files skipped from review due to trivial changes (3)
🚧 Files skipped from review as they are similar to previous changes (4)
WalkthroughResetPasswordConfirm component replaced hardcoded English text with react-i18next ChangesPassword Reset Confirmation Internationalization
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
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. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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.
Actionable comments posted: 1
🧹 Nitpick comments (1)
web/default/src/i18n/locales/en.json (1)
874-875: ⚡ Quick winUse hierarchical i18n keys for the new reset-password-confirm strings.
These new keys are phrase-based; please switch them to semantic namespaced keys (for example
auth.resetPasswordConfirm.title,description,retry,backToLogin,success) and keep the same structure across all locale files and the consuming component.As per coding guidelines,
web/default/src/i18n/**/*.{ts,tsx,json}should “Use hierarchical and semantically clear translation key names such asdashboard.overview.titleand maintain naming consistency”.Also applies to: 3306-3306, 3316-3316, 4401-4401
🤖 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 `@web/default/src/i18n/locales/en.json` around lines 874 - 875, Rename the two flat phrase keys ("Confirm reset password" and "Confirm the reset request to generate a new password.") to hierarchical semantic keys under auth.resetPasswordConfirm (e.g. auth.resetPasswordConfirm.title and auth.resetPasswordConfirm.description), update the consuming component to reference auth.resetPasswordConfirm.title and auth.resetPasswordConfirm.description (and add other keys like retry, backToLogin, success if present/needed), and apply the same key names and structure across all locale files that contain these strings so the i18n lookup is consistent.
🤖 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.
Inline comments:
In `@web/default/src/i18n/locales/fr.json`:
- Around line 874-875: The two new French translation keys use full English
phrases ("Confirm reset password" and "Confirm the reset request to generate a
new password.") instead of hierarchical semantic keys; rename them to structured
keys such as auth.resetPasswordConfirm.title and auth.resetPasswordConfirm.retry
in this fr.json and make the identical key-name changes in all other locale
files (and update any TSX call sites that reference the old phrase-keys to the
new auth.resetPasswordConfirm.* keys) so translation lookups remain consistent
with the project's naming convention.
---
Nitpick comments:
In `@web/default/src/i18n/locales/en.json`:
- Around line 874-875: Rename the two flat phrase keys ("Confirm reset password"
and "Confirm the reset request to generate a new password.") to hierarchical
semantic keys under auth.resetPasswordConfirm (e.g.
auth.resetPasswordConfirm.title and auth.resetPasswordConfirm.description),
update the consuming component to reference auth.resetPasswordConfirm.title and
auth.resetPasswordConfirm.description (and add other keys like retry,
backToLogin, success if present/needed), and apply the same key names and
structure across all locale files that contain these strings so the i18n lookup
is consistent.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: af8ef73a-6772-401e-9766-9c031994c35f
📒 Files selected for processing (7)
web/default/src/features/auth/reset-password-confirm/index.tsxweb/default/src/i18n/locales/en.jsonweb/default/src/i18n/locales/fr.jsonweb/default/src/i18n/locales/ja.jsonweb/default/src/i18n/locales/ru.jsonweb/default/src/i18n/locales/vi.jsonweb/default/src/i18n/locales/zh.json
|
Addressed the CodeRabbit i18n key feedback in d5daccc by renaming the new reset-password confirmation strings to Validation run locally:
|
Calcium-Ion
left a comment
There was a problem hiding this comment.
Approving. Hardcoded English strings in web/default/src/features/auth/reset-password-confirm/index.tsx are now rendered through t(...) under auth.resetPasswordConfirm.* keys, and all six locales (en/zh/fr/ru/ja/vi) are kept in sync per the project i18n flow. Fixes #4764.
* fix(auth): localize reset password confirmation Wrap reset confirmation page copy in frontend i18n calls and add matching locale entries so the page no longer mixes translated labels with hardcoded English copy. * fix(auth): use semantic reset i18n keys
Range: 18282e6..3b9ed0a8 (upstream/main as of fetch) Highlights: - feat: support request_header key source (QuantumNous#4903) - feat: Waffo Pancake gateway + admin catalog binding (QuantumNous#4935) - perf: optimize request metadata extraction, drop dead batch helpers in relay/channel/openai/helper.go (QuantumNous#5009) - perf: reduce heap residency for large base64 relay requests - fix(channel): evict auto-disabled multi-key channels from cache (QuantumNous#4983) - fix: resolve model owned_by from active channels (QuantumNous#4416) — introduces channelOwnerName/getPreferredModelOwners/buildOpenAIModel + ListModels refactor - fix: GetAllChannels respects group filter (QuantumNous#4847, QuantumNous#4885) - fix(auth): expose register_enabled, aff_code, localize reset (QuantumNous#4871, QuantumNous#4945, QuantumNous#4769) - fix(webhook): processing + Waffo subscription compliance (QuantumNous#5047, QuantumNous#5038) - refactor(ui): system settings drill-in sidebar + log filter responsiveness Conflicts resolved: - controller/model.go: kept local hiddenMappedModels filter (resolveAccessibleModelGroups + getHiddenMappedModelNamesForGroups) on top of upstream's ListModels refactor; adopted upstream channelOwnerName helper. - relay/channel/openai/helper.go: adopted upstream (HEAD's processChatCompletions/processCompletions were dead code after upstream's perf refactor in QuantumNous#5009). Local patches verified intact: Username + fillTopUpUsernames (model/topup.go, locked by topup_username_test.go), HideUpstreamErrors, Claude developer-role normalization, Gemini role fallback, Model Chat header nav entry, channel affinity auto-clear. Note: go build not run (no Go toolchain in this environment); CI to verify. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
* fix(auth): localize reset password confirmation Wrap reset confirmation page copy in frontend i18n calls and add matching locale entries so the page no longer mixes translated labels with hardcoded English copy. * fix(auth): use semantic reset i18n keys
* fix(auth): localize reset password confirmation Wrap reset confirmation page copy in frontend i18n calls and add matching locale entries so the page no longer mixes translated labels with hardcoded English copy. * fix(auth): use semantic reset i18n keys
* fix(auth): localize reset password confirmation Wrap reset confirmation page copy in frontend i18n calls and add matching locale entries so the page no longer mixes translated labels with hardcoded English copy. * fix(auth): use semantic reset i18n keys
* fix(auth): localize reset password confirmation Wrap reset confirmation page copy in frontend i18n calls and add matching locale entries so the page no longer mixes translated labels with hardcoded English copy. * fix(auth): use semantic reset i18n keys
📝 变更描述 / Description
重置密码确认页有几处用户可见文案仍是硬编码英文,导致非英文界面下出现混合语言。这个 PR 将这些文案改为通过 default 前端的
t(...)渲染,并为en/zh/fr/ru/ja/vi补齐对应 locale key。Part of #3490. Related to #1906.
🚀 变更类型 / Type of change
🔗 关联任务 / Related Issue
✅ 提交前检查项 / Checklist
Bug fix,我已提交或关联对应 Issue,且不会将设计取舍、预期不一致或理解偏差直接归类为 bug。📸 运行证明 / Proof of Work
Base:
QuantumNous/new-api@ba474393本地验证:
验证结果:
bun run typecheck通过bunx eslint src/features/auth/reset-password-confirm/index.tsx通过变更范围:
web/default/src/features/auth/reset-password-confirm/index.tsxweb/default/src/i18n/locales/{en,zh,fr,ru,ja,vi}.jsonSummary by CodeRabbit