fix(relay): localize API error messages - #4918
Conversation
- Route token auth, rate-limit, relay retry, playground, and Jimeng upload errors through backend i18n. - Add matching en, zh-CN, and zh-TW locale messages. - Keep logs and admin-only text out of scope.
|
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 (9)
WalkthroughThis PR replaces hardcoded Chinese error messages with localized i18n-driven messaging throughout the application. New translation keys are defined for auth, channel, rate-limit, playground, and task domains, with English and Chinese (Simplified and Traditional) locale strings provided. Middleware, controllers, and adapters are updated to use ChangesComprehensive i18n localization of error messages
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
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
PR Notice
Description
Several user-facing API and relay errors were still hardcoded as Chinese strings. This moves those messages to the existing i18n locale files and returns localized API errors at the response boundary.
The scope covers token auth checks, model rate limits, playground access token rejection, relay channel retry errors, task saturation messages, and Jimeng upload size validation.
Type of change
Related Issue
Checklist
Proof of Work
gofmt -w middleware/auth.go middleware/model-rate-limit.go controller/playground.go controller/relay.go relay/channel/task/jimeng/adaptor.go i18n/keys.gogo test ./middleware ./controller ./relay/channel/task/jimeng ./i18nen,zh-CN, andzh-TWen,zh-CN, andzh-TWgit diff --checkSummary by CodeRabbit