feat(ui): localize interpolated backend error messages (RI-8268)#6142
Conversation
🛡️ Jit Security Scan Results✅ No security findings were detected in this PR
Security scan by Jit
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b505d9d. Configure here.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b505d9d087
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Code Coverage - Backend unit tests
Test suite run success3621 tests passing in 319 suites. Report generated by 🧪jest coverage report action from b505d9d |
b505d9d to
12af3e9
Compare
Code Coverage - Integration Tests
|
12af3e9 to
e7a0c5a
Compare
Code Coverage - Frontend unit tests
Test suite run success7474 tests passing in 840 suites. Report generated by 🧪jest coverage report action from f2651b9 |
7dc70db to
5c6f079
Compare
e7a0c5a to
f2651b9
Compare
5c6f079 to
8dc98e3
Compare
f2651b9 to
db539ee
Compare
8dc98e3 to
b0a0d6b
Compare
Add api.error.code.<n>.message templates (en + bg) for the codes whose
backend now emits a structured `resource`, interpolating the values:
{{url}} (10904/10907), {{filename}} (11706), {{id}} (11405), and {{detail}}
for the freeform framing codes (detail on its own line). Titles are
unchanged; getTranslatedApiError already spreads `resource` into the
interpolation, so no infra change is needed.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Freeform localized error messages place the interpolated detail on its own
line ("…framing.\n{{detail}}"); apply white-space: pre-line so the break
renders instead of collapsing to a space.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
db539ee to
60b784a
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 60b784a209
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "api.error.code.11403.message": "RDI encountered a server error.\n{{detail}}", | ||
| "api.error.code.11404.title": "Validation error", | ||
| "api.error.code.11405.title": "Resource not found", | ||
| "api.error.code.11405.message": "RDI with id {{id}} was not found.", |
There was a problem hiding this comment.
Preserve backend detail for RDI 404s without ids
This template assumes every 11405 response includes resource.id, but the RDI upstream-error path still does not: wrapRdiPipelineError constructs RdiPipelineNotFoundException(message, errorOptions) for 404s, and the existing rdi-pipeline.error.handler.spec.ts expectation for that response contains no resource. Fresh evidence from that path means these RDI API 404s now take the localized-template branch in getTranslatedApiError/parseCustomError and render a missing-id message instead of the backend detail (for example “User was not found”); please fall back unless resource.id is present or template this case from detail/message.
Useful? React with 👍 / 👎.

What
The backend now emits the runtime value baked into certain error messages as a structured
resource(see the BE PR #6141). This adds the translatedapi.error.code.<n>.messagetemplates that interpolate those values, so previously title-only codes get a fully localized body.getTranslatedApiErroralready spreadsresponse.data.resourceintoi18n.t(key, {...resource}), so no infra change — just data + one render tweak.Locale messages (en + bg)
{{url}}, 11706 →{{filename}}{{detail}}on its own lineTitles unchanged. When the backend omits
resource(its generic-default guard), the code falls back to title-only.How to test (local, no backend needed)
Add this throwaway helper to fire each resource-carrying error toast, then remove it before committing. Create
redisinsight/ui/src/utils/devApiErrorTrigger.ts:Then call it once from
App.tsx:Run
yarn dev:ui, then in the browser console:Use
?lang=bgto verify the Bulgarian translations interpolate the same values.🤖 Generated with Claude Code
Note
Low Risk
Locale and notification presentation changes only; no auth or API client logic changes beyond showing richer translated error copy.
Overview
Adds localized
api.error.code.*.messagestrings in English and Bulgarian for API errors that now ship structuredresourcefrom the backend, so toasts show a full translated body instead of title-only where a template was missing.Templates use
{{url}},{{filename}},{{id}}, or a second line with{{detail}}(e.g. connection, auth profile, cloud unexpected, RDI, import parse). ExistinggetTranslatedApiErroralready passesresourceinto i18n; this PR is locale data plus display.DefaultErrorContentnow renders through a styledErrorTextwithwhite-space: pre-lineso\nin messages (especially{{detail}}on its own line) shows as a line break in error notifications.Reviewed by Cursor Bugbot for commit 60b784a. Bugbot is set up for automated code reviews on this repo. Configure here.