i18n(loop/errors): localize DeepSeek error messages#444
Merged
Conversation
formatLoopError, reasonPrefixFor, and errorLabelFor were all hardcoded English. A Chinese user hitting a 503 / 401 / context overflow saw raw English (and on top of that, the new 5xx outage notice from #440 was also English). Move the strings to a new errors.* i18n namespace covering: - context overflow (with V4/legacy limit mention) - 401 auth / 402 balance / 422 param / 400 bad request - 5xx head + reachable / unreachable / two action variants - reason prefix and label for budget/aborted/context-guard/stuck - "(no message)" fallback for empty error bodies zh-CN translations included. Existing tests still cover EN (vitest setupFile pins runtime to EN); two new tests flip to zh-CN to confirm runtime switch actually translates. Stacked on #440 — merge that first.
This was referenced May 8, 2026
ChasLui
pushed a commit
to ChasLui/DeepSeek-Reasonix
that referenced
this pull request
May 23, 2026
formatLoopError, reasonPrefixFor, and errorLabelFor were all hardcoded English. A Chinese user hitting a 503 / 401 / context overflow saw raw English (and on top of that, the new 5xx outage notice from esengine#440 was also English). Move the strings to a new errors.* i18n namespace covering: - context overflow (with V4/legacy limit mention) - 401 auth / 402 balance / 422 param / 400 bad request - 5xx head + reachable / unreachable / two action variants - reason prefix and label for budget/aborted/context-guard/stuck - "(no message)" fallback for empty error bodies zh-CN translations included. Existing tests still cover EN (vitest setupFile pins runtime to EN); two new tests flip to zh-CN to confirm runtime switch actually translates. Stacked on esengine#440 — merge that first.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
formatLoopError,reasonPrefixFor, anderrorLabelForwere all hardcoded English. A Chinese user hitting a 503 / 401 / context-overflow saw raw English in the chat — same class of UX gap as #440, just on the i18n axis.This includes the new 5xx outage notice from #440 (now in main).
What
New `errors.*` i18n namespace covering:
zh-CN translations for all 20 keys. The user-visible `{inner}` server message (e.g. "Authentication Fails") is preserved verbatim — translating DS's own response would be wrong.
Test plan
Note
Replaces #441 (closed). Original branch was stacked on the now-merged `fix/loop-deepseek-5xx-friendly`; new branch is rebased onto main.