fix(auth): localize public auth messages - #4800
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 (7)
WalkthroughEmail verification, password reset, and Turnstile validation workflows are refactored to use localized i18n messages. Message keys are defined, handlers and middleware are updated to translate errors and email templates, and translations for English and Simplified/Traditional Chinese locales are provided. ChangesAuthentication Message Internationalization
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
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)
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 |
51fdfc5 to
2b6f1df
Compare
📝 变更描述 / Description
公开认证流程里仍有几处用户可见中文或固定英文文案,包括邮箱验证码、密码重置邮件、邮箱限制提示、密码重置链接错误、邮箱验证码限流提示,以及 Turnstile 校验错误。
这个 PR 将这些文案接入后端 i18n:
SendEmailVerification使用 i18n 返回邮箱参数/域名/别名/占用错误,并生成本地化验证码邮件主题和正文。SendPasswordResetEmail使用 i18n 生成密码重置邮件主题和正文。ResetPassword使用 i18n 返回无效参数和重置链接无效/过期错误。common.TranslateMessage返回本地化错误。Part of #3490. Related to #1906.
🚀 变更类型 / Type of change
🔗 关联任务 / Related Issue
✅ 提交前检查项 / Checklist
Bug fix,我已提交或关联对应 Issue,且不会将设计取舍、预期不一致或理解偏差直接归类为 bug。📸 运行证明 / Proof of Work
Base:
QuantumNous/new-api@ba474393本地验证使用与 Dockerfile 一致的 Go 镜像: