You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Related issue: #3188
Validation tasks: none (English shows the server's text unchanged)
Stacked on #3893; the full stack order is in #3723.
When the API rejects a request, the web app shows the server's English detail even in a translated interface. The v2 API identifies every problem by type and every field error by code, so the client can show its own translation. This PR translates them.
Approach
V2ProblemError.message and a new problemFieldDetail() pick, in a translated interface: the field error's error.field.<code>, then error.<type>, then the server's detail. English always shows the server's text. The message is computed once, when the error arrives, so it stays a plain property that survives structuredClone. The field-detail readers (admin requests and libraries, item edits, new password, autoscan, profile home sections) use the helper.
Apple and Android use the same error.* keys in their own PRs.
Validation
Web tests, typecheck and ESLint pass on this branch. A new table test covers the order (field code, then type, then detail) and fails without the change.
On a sandbox (see Evidence): the same 422 shows the server's English in English and the catalog text in Spanish, Arabic, German and Japanese.
Involvement: Fully AI-generated; human review pending
Adversarial review: plan reviewed by Codex (gpt-6.1-sol) and Claude (claude-opus-5-5); one adversarial round by Codex (gpt-6.1-sol) found a read-time getter that structuredClone dropped, fixed here. Background review by Codex (gpt-6.1-sol) on 28b13b9: F1 (a translated generic field message replaces a server detail that names a limit) is the cross-client rule all clients follow; left for a maintainer decision, with structured limits in v2 field errors as the proposed fix.
Add web interface translations with react-intl, locale-aware formatting, and language pickers
Adds an i18n layer using react-intl: a message catalog in catalog.ts, typed message keys, and formatting with English fallback and right-to-left argument isolation in format.ts
Adds locale catalogs for en, de, es, fr, ja, pt-BR, zh-Hans, ar, and pseudo-locales, managed by the new sync-translations script
Adds a LocaleProvider in useAppLocale.tsx that resolves the app language from the profile setting, a signed-out choice, or the browser, and loads localized language-name data in languageNames.ts
Adds language pickers on auth screens and in accessibility settings, and switches date, number, and relative-time formatting across the app to the app format locale (e.g. datetime.ts, timeAgo.ts, calendarWeek.ts)
Localizes V2 problem errors: V2ProblemError messages and field errors now resolve via problemText/problemFieldDetail in request.ts, and the client sends Accept-Language from appLanguage()
Replaces static LANGUAGES lists with languageOptions() from languageNames.ts across subtitle, metadata, and translate selectors
Behavioral Change: API problem error messages are fixed at construction time in the active locale rather than being the raw server detail; language selectors now derive from languageOptions() and change content when the app language changes
We couldn't safely recover the incremental review. No full review was started, and the last reviewed checkpoint was preserved. Retry later, or explicitly request a full review by commenting @coderabbitai full review.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
V2 problem errors now use localized problem and field text. Validation error displays across admin, image, autoscan, password, and profile flows use the shared field-detail helper.
Changes: Localized v2 problem errors
Layer / File(s)
Summary
Problem message and field-detail localization web/src/api/v2/request.ts, web/src/api/v2/request.test.ts, web/src/i18n/README.md
V2ProblemError.message now resolves translated field text or problem text when the error is constructed. problemFieldDetail() resolves a field translation with the server detail as fallback. Tests cover translations, fallbacks, and message retention after locale changes and cloning.
Silo-Server/silo-server#3516: Adds admin profile mutations whose hooks display API error messages, related to the localized problem text used by this PR.
Some autoscan rejection toasts can omit the source-specific recovery advice in translated interfaces. This is a bounded, acknowledged follow-up rather than a merge blocker.
Security architecture risk: Low · up to 8c45b
The inspected changes localize error text without changing error identities, privileges, or authentication decisions. No introduced security concern was established, but downstream coverage is incomplete.
Retained concerns
No architecture-level concerns identified.
Security review details
Security Blast Radius
inferred — The demonstrated propagation is shared web-client error presentation across multiple workflows. The inspected changes do not add an endpoint or grant authority; incomplete downstream coverage prevents an exhaustive statement about every consumer.
Trust Boundaries and Controls
observed — Inspected authentication and device-approval consumers discriminate using status, problemType, and retryAfterSeconds rather than localized message text. These controls retain the structured fields preserved by the constructor.
Pre-merge checks: 5
Check name
Status
Explanation
Title check
The title clearly summarizes the main change: translating v2 API problem details in the web app.
Description check
The description explains the problem, approach, affected web flows, and validation for the v2 problem-message translations.
Docstring Coverage
Docstring coverage is 85.71% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentati…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage
Explanation
Docstring coverage is 85.71% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 7 functions across 9 files. (1 skipped: 1 unsupported.)
Finishing Touches
Generate docstrings
Commit to this branch
Create a new PR
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: 93c737bc-d377-4bef-b88d-20803c5beac5
Commits
Reviewing files that changed from the base of the PR and between 8c8262a and 8c45b36.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
Please add phone-width before-and-after captures of the translated problem toast and a field-error example, or explain why mobile web is unaffected. The Evidence section names desktop only, but this changes shared error text used by phone-width screens; CONTRIBUTING.md requires evidence for both web surfaces.
971-971: Minor · Functional Correctness · Quick win
Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.
Deduplicate the toast text in a translated interface.
V2ProblemError.message now equals the translation of the first field error's error.field.<code> when that key exists. problemFieldDetail returns the same text for that first field. The toast then shows the same sentence twice. Example: a Spanish catalog that has error.field.path_rewrite_required produces "X X Y". In English the texts differ, so this does not happen.
problemMessage in web/src/hooks/queries/admin/requests.ts already removes duplicates with a Set. Use the same approach here.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.
V2ProblemError.message and problemFieldDetail() translate server
problems in a translated interface: error.field.<code>, then
error.<type>, else the server's detail. The message is computed once, in
the language current when the error arrives, so it stays a plain property
that survives structuredClone. Field-detail readers use the helper.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Without a field error the toast read the server's detail directly,
so a translated interface still showed English. It now uses the
error's message, which is translated.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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
api-v2API v2 / Huma migration program (epic #135); long-running, stacked by phaseenhancementNew feature or requestevidence-requiredNeeds before-and-after evidence before the Evidence check passesimpact: usabilityCore flow broken or severely blockedjavascriptPull requests that update javascript codepriority: P2Limited scope, workaround exists, or polishsize/M50–199 added + deleted lines (all files); change volume, not priority.stackedBase is another open PR; merge in stack order named in the body
1 participant
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.
Problem
Related issue: #3188
Validation tasks: none (English shows the server's text unchanged)
Stacked on #3893; the full stack order is in #3723.
When the API rejects a request, the web app shows the server's English
detaileven in a translated interface. The v2 API identifies every problem by type and every field error by code, so the client can show its own translation. This PR translates them.Approach
V2ProblemError.messageand a newproblemFieldDetail()pick, in a translated interface: the field error'serror.field.<code>, thenerror.<type>, then the server'sdetail. English always shows the server's text. The message is computed once, when the error arrives, so it stays a plain property that survivesstructuredClone. The field-detail readers (admin requests and libraries, item edits, new password, autoscan, profile home sections) use the helper.Apple and Android use the same
error.*keys in their own PRs.Validation
Evidence
Evidence: https://evidence.siloserver.org/r/silo-server/pr-3894/
Surface and build: web app, desktop; English on
mainand on a build of the whole stack, and Spanish, Arabic, German and Japanese on that build.Risks
None identified.
Checklist
AI Disclosure
🤖 Generated with Claude Code
Note
Add web interface translations with react-intl, locale-aware formatting, and language pickers
react-intl: a message catalog in catalog.ts, typed message keys, and formatting with English fallback and right-to-left argument isolation in format.tsLocaleProviderin useAppLocale.tsx that resolves the app language from the profile setting, a signed-out choice, or the browser, and loads localized language-name data in languageNames.tsV2ProblemErrormessages and field errors now resolve viaproblemText/problemFieldDetailin request.ts, and the client sendsAccept-LanguagefromappLanguage()LANGUAGESlists withlanguageOptions()from languageNames.ts across subtitle, metadata, and translate selectorslanguageOptions()and change content when the app language changesMacroscope summarized 223e9e5.