Skip to content

fix(auth): localize reset password confirmation - #4769

Merged
Calcium-Ion merged 2 commits into
QuantumNous:mainfrom
neow021:fix/reset-password-confirm-i18n
May 19, 2026
Merged

fix(auth): localize reset password confirmation#4769
Calcium-Ion merged 2 commits into
QuantumNous:mainfrom
neow021:fix/reset-password-confirm-i18n

Conversation

@neow021

@neow021 neow021 commented May 11, 2026

Copy link
Copy Markdown
Contributor

📝 变更描述 / Description

重置密码确认页有几处用户可见文案仍是硬编码英文,导致非英文界面下出现混合语言。这个 PR 将这些文案改为通过 default 前端的 t(...) 渲染,并为 en/zh/fr/ru/ja/vi 补齐对应 locale key。

Part of #3490. Related to #1906.

🚀 变更类型 / Type of change

  • 🐛 Bug 修复 (Bug fix) - 请关联对应 Issue,避免将设计取舍、理解偏差或预期不一致直接归类为 bug
  • ✨ 新功能 (New feature) - 重大特性建议先通过 Issue 沟通
  • ⚡ 性能优化 / 重构 (Refactor)
  • 📝 文档更新 (Documentation)

🔗 关联任务 / Related Issue

✅ 提交前检查项 / Checklist

  • 人工确认: 我已亲自整理并撰写此描述,没有直接粘贴未经处理的 AI 输出。
  • 非重复提交: 我已搜索现有的 IssuesPRs,确认不是重复提交。
  • Bug fix 说明: 若此 PR 标记为 Bug fix,我已提交或关联对应 Issue,且不会将设计取舍、预期不一致或理解偏差直接归类为 bug。
  • 变更理解: 我已理解这些更改的工作原理及可能影响。
  • 范围聚焦: 本 PR 未包含任何与当前任务无关的代码改动。
  • 本地验证: 已在本地运行并通过测试或手动验证,维护者可以据此复核结果。
  • 安全合规: 代码中无敏感凭据,且符合项目代码规范。

📸 运行证明 / Proof of Work

Base: QuantumNous/new-api@ba474393

本地验证:

cd web/default
bun install --frozen-lockfile
bun run typecheck
bunx eslint src/features/auth/reset-password-confirm/index.tsx
bun -e "const fs=require('fs'); for (const f of fs.readdirSync('src/i18n/locales').filter(f=>f.endsWith('.json'))) JSON.parse(fs.readFileSync('src/i18n/locales/'+f,'utf8')); console.log('locale json ok')"

验证结果:

  • bun run typecheck 通过
  • bunx eslint src/features/auth/reset-password-confirm/index.tsx 通过
  • locale JSON 解析通过

变更范围:

  • web/default/src/features/auth/reset-password-confirm/index.tsx
  • web/default/src/i18n/locales/{en,zh,fr,ru,ja,vi}.json

Summary by CodeRabbit

  • Internationalization
    • Added English, French, Japanese, Russian, Vietnamese, and Chinese translations for the password reset confirmation flow (confirmation prompt, description, retry countdown, return-to-login, and success message).
  • New Features
    • UI now uses localized text for post-submit status and primary action labels, including conditional "return to login", a timed "retry (Xs)" label, and "confirm reset password" prompts.

Review Change Stack

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.
@coderabbitai

coderabbitai Bot commented May 11, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 272d84e8-a312-4c38-8492-632a20ff7cad

📥 Commits

Reviewing files that changed from the base of the PR and between 2500973 and d5daccc.

📒 Files selected for processing (7)
  • web/default/src/features/auth/reset-password-confirm/index.tsx
  • web/default/src/i18n/locales/en.json
  • web/default/src/i18n/locales/fr.json
  • web/default/src/i18n/locales/ja.json
  • web/default/src/i18n/locales/ru.json
  • web/default/src/i18n/locales/vi.json
  • web/default/src/i18n/locales/zh.json
✅ Files skipped from review due to trivial changes (3)
  • web/default/src/i18n/locales/ru.json
  • web/default/src/i18n/locales/en.json
  • web/default/src/i18n/locales/fr.json
🚧 Files skipped from review as they are similar to previous changes (4)
  • web/default/src/features/auth/reset-password-confirm/index.tsx
  • web/default/src/i18n/locales/zh.json
  • web/default/src/i18n/locales/ja.json
  • web/default/src/i18n/locales/vi.json

Walkthrough

ResetPasswordConfirm component replaced hardcoded English text with react-i18next t() calls; six locale JSON files (en, fr, ja, ru, vi, zh) gained four translation keys each: confirmation prompt+description, retry countdown, return-to-login, and success message.

Changes

Password Reset Confirmation Internationalization

Layer / File(s) Summary
Component Translation Wiring
web/default/src/features/auth/reset-password-confirm/index.tsx
ResetPasswordConfirm now uses t() for post-submit paragraph and primary button labels: "Confirm reset password", "Retry ({{seconds}}s)" (interpolating secondsLeft), and "Return to login".
Translation Entries
web/default/src/i18n/locales/en.json, web/default/src/i18n/locales/fr.json, web/default/src/i18n/locales/ja.json, web/default/src/i18n/locales/ru.json, web/default/src/i18n/locales/vi.json, web/default/src/i18n/locales/zh.json
Added four new keys per locale: confirmation title+description, retry countdown with {{seconds}}, return-to-login label, and password reset success message.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • seefs001

Poem

🐰 I hopped through keys and strings today,
Swapped English lines for locales' say,
Six tongues now sing one tiny part—
A reset message, straight from the heart. ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title clearly summarizes the main change: localizing the reset password confirmation component by replacing hard-coded English strings with i18n keys across multiple language locales.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
web/default/src/i18n/locales/en.json (1)

874-875: ⚡ Quick win

Use 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 as dashboard.overview.title and 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

📥 Commits

Reviewing files that changed from the base of the PR and between ba47439 and 2500973.

📒 Files selected for processing (7)
  • web/default/src/features/auth/reset-password-confirm/index.tsx
  • web/default/src/i18n/locales/en.json
  • web/default/src/i18n/locales/fr.json
  • web/default/src/i18n/locales/ja.json
  • web/default/src/i18n/locales/ru.json
  • web/default/src/i18n/locales/vi.json
  • web/default/src/i18n/locales/zh.json

Comment thread web/default/src/i18n/locales/fr.json Outdated
@neow021

neow021 commented May 11, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the CodeRabbit i18n key feedback in d5daccc by renaming the new reset-password confirmation strings to auth.resetPasswordConfirm.* keys across all locale files and updating the component call sites.

Validation run locally:

  • bun run typecheck
  • bunx eslint src/features/auth/reset-password-confirm/index.tsx
  • locale JSON parse check for en/fr/ja/ru/vi/zh
  • git diff --check

@Calcium-Ion Calcium-Ion left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Calcium-Ion
Calcium-Ion merged commit cb9270e into QuantumNous:main May 19, 2026
1 check passed
reggie-lula pushed a commit to WhaleCrane/new-api-hz that referenced this pull request May 21, 2026
* 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
yiranxiaohui added a commit to yiranxiaohui/new-api that referenced this pull request May 25, 2026
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>
xyfacai pushed a commit to xyfacai/new-api that referenced this pull request May 30, 2026
* 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
SamuelSxy pushed a commit to SamuelSxy/new-api-rh that referenced this pull request Jun 7, 2026
* 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
fx247562340 pushed a commit to fx247562340/vancine-platform that referenced this pull request Jun 11, 2026
* 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
330079598 pushed a commit to 330079598/new-api that referenced this pull request Aug 19, 2026
* 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
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.

2 participants