RI-8272 i18n: translate consent copy via agreement codes#6157
RI-8272 i18n: translate consent copy via agreement codes#6157valkirilov wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dac26ea3e2
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: edce8da62f
ℹ️ 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 success3647 tests passing in 319 suites. Report generated by 🧪jest coverage report action from b45a98e |
Code Coverage - Integration Tests
|
7199cc0 to
d03e2b8
Compare
… (RI-8272)
The Notifications/Privacy consent toggle labels and descriptions come from
the backend agreements spec, so they were previously untranslatable. Add a
stable `code` to each agreement in the spec (mirroring the error-code
contract); the UI localizes `api.agreement.<code>.{label,description}` with
the spec's English as the fallback, and the Privacy Policy link text via
common.privacyPolicy. Falls back to the agreement name when no code is sent,
so it works against older API builds too.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Custom agreement specs (RI_AGREEMENTS_PATH) keep the standard keys but may change label/description and ship no code. Falling back to agreementName would override that authoritative copy with the built-in translation, so translate only when the backend provides a stable code. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
A custom RI_AGREEMENTS_PATH spec copied from the bundled one keeps the new code fields, so the UI would translate (and override) its customized legal copy. Strip codes when serving a file-based spec so custom text stays authoritative; the bundled default keeps its codes and is still translated. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…-8272) The GET /settings/agreements/spec Joi schema rejects unknown keys, so the new `code` field failed validation. Add it as an optional string. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
8a43aa1 to
b45a98e
Compare
Code Coverage - Frontend unit tests
Test suite run success7595 tests passing in 847 suites. Report generated by 🧪jest coverage report action from b45a98e |
What
Translate the consent copy (Notifications & Privacy sections) that #6154 left out because it isn't authored in the UI — it comes from the backend agreements spec.
Approach mirrors the existing error-code i18n contract:
agreements-spec.jsongets a stablecode(analytics,notifications, theencryptionoptions,eula)ConsentOptionlocalizesapi.agreement.<code>.{label,description}with the spec's English as thedefaultValuefallback. Falls back to the agreement name when no code is sent, so it degrades gracefully against older API builds.Translations added for
analytics+notifications(the consents shown in Settings);encryption/eulaget codes and fall back to English until translated later — no further backend work needed.Screenshots (EN | BG)
Testing
Closes RI-8272
Related community requests: #605, #1317, #1883, #2040, #2137, #2181, #2213, #2417, #2550, #2590, #2695, #2715, #2716, #2727, #2828, #2912, #2943, #2945, #3081, #3141, #3142, #3319, #3411, #3601, #3625, #3628, #3663, #3671, #3812, #3815, #4150, #4182, #4408, #4664, #4672, #4744, #5052, #5967
🤖 Generated with Claude Code
Note
Low Risk
Display-only i18n and optional API fields; custom-spec code stripping is intentional for legal copy. No change to consent storage or agreement validation logic.
Overview
Adds stable
codefields on bundled agreements (analytics,notifications, encryption variants,eula) so consent labels and descriptions can be localized like API error codes.Frontend:
ConsentOptionresolvesapi.agreement.<code>.{label,description}via i18n, using the spec’s English asdefaultValue. Ifcodeis missing, it shows server text unchanged (custom specs and older APIs).ItemDescriptionusescommon.privacyPolicyfor the linked text.Backend: When loading a custom agreements file (
RI_AGREEMENTS_PATH),codeis stripped so enterprise/custom legal copy is not overridden by built-in translations.Locales: EN/BG strings for analytics and notifications; encryption/eula codes fall back to English until translated. API schema test allows optional
code; unit tests cover localization and custom-spec behavior.Reviewed by Cursor Bugbot for commit b45a98e. Bugbot is set up for automated code reviews on this repo. Configure here.