Skip to content

RI-8272 i18n: translate consent copy via agreement codes#6157

Open
valkirilov wants to merge 4 commits into
fe/feature/RI-8272/i18n-migrate-settingsfrom
feature/RI-8272/consent-i18n-codes
Open

RI-8272 i18n: translate consent copy via agreement codes#6157
valkirilov wants to merge 4 commits into
fe/feature/RI-8272/i18n-migrate-settingsfrom
feature/RI-8272/consent-i18n-codes

Conversation

@valkirilov

@valkirilov valkirilov commented Jul 6, 2026

Copy link
Copy Markdown
Member

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:

  • Backend — each agreement in agreements-spec.json gets a stable code (analytics, notifications, the encryption options, eula)
  • FrontendConsentOption localizes api.agreement.<code>.{label,description} with the spec's English as the defaultValue fallback. 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/eula get codes and fall back to English until translated later — no further backend work needed.

Screenshots (EN | BG)

Section English Български
Privacy (Usage Data consent) en-consent-privacy bg-consent-privacy
General (Notifications consent) en-consent-general bg-consent-general

Testing

  • Manual: open Settings, toggle Language EN↔BG; the Usage Data & Show notification consent labels/descriptions + Privacy Policy link translate.

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 code fields on bundled agreements (analytics, notifications, encryption variants, eula) so consent labels and descriptions can be localized like API error codes.

Frontend: ConsentOption resolves api.agreement.<code>.{label,description} via i18n, using the spec’s English as defaultValue. If code is missing, it shows server text unchanged (custom specs and older APIs). ItemDescription uses common.privacyPolicy for the linked text.

Backend: When loading a custom agreements file (RI_AGREEMENTS_PATH), code is 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.

@valkirilov valkirilov requested a review from a team as a code owner July 6, 2026 13:31

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread redisinsight/ui/src/components/consents-settings/ConsentOption/ConsentOption.tsx Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Code Coverage - Backend unit tests

St.
Category Percentage Covered / Total
🟢 Statements 93.08% 16501/17728
🟡 Branches 75.21% 5231/6955
🟢 Functions 87.35% 2527/2893
🟢 Lines 92.94% 15777/16976

Test suite run success

3647 tests passing in 319 suites.

Report generated by 🧪jest coverage report action from b45a98e

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Code Coverage - Integration Tests

Status Category Percentage Covered / Total
🟡 Statements 79.16% 18187/22974
🟡 Branches 61.93% 8472/13678
🟡 Functions 66.87% 2457/3674
🟡 Lines 78.77% 17123/21736

@valkirilov valkirilov force-pushed the fe/feature/RI-8272/i18n-migrate-settings branch from 7199cc0 to d03e2b8 Compare July 6, 2026 14:12
valkirilov and others added 4 commits July 6, 2026 17:13
… (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>
@valkirilov valkirilov force-pushed the feature/RI-8272/consent-i18n-codes branch from 8a43aa1 to b45a98e Compare July 6, 2026 14:14
@valkirilov valkirilov self-assigned this Jul 6, 2026
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Code Coverage - Frontend unit tests

St.
Category Percentage Covered / Total
🟢 Statements 83.71% 26844/32069
🟡 Branches 69.41% 11421/16454
🟡 Functions 79.01% 7172/9077
🟢 Lines 84.17% 26150/31068

Test suite run success

7595 tests passing in 847 suites.

Report generated by 🧪jest coverage report action from b45a98e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant