Skip to content

RI-8268 Translate success & infinite notifications (round 2)#6126

Merged
valkirilov merged 4 commits into
mainfrom
fe/RI-8268/translate-success-infinite
Jul 2, 2026
Merged

RI-8268 Translate success & infinite notifications (round 2)#6126
valkirilov merged 4 commits into
mainfrom
fe/RI-8268/translate-success-infinite

Conversation

@valkirilov

@valkirilov valkirilov commented Jun 29, 2026

Copy link
Copy Markdown
Member

What

Round 2 of frontend notification translation, stacked on the round-1 error-path PR (#6125). This round localizes the success and infinite (persistent/in-progress) toasts, and aligns the whole notification namespace.

Testing

Manual — drop this dev helper into App.tsx (after the themeService calls) to
trigger every toast from the browser console, then remove it:

// App.tsx — dev-only, do not commit. Add these imports too:
//   import { addMessageNotification, addInfiniteNotification } from 'uiSrc/slices/app/notifications'
//   import successMessages from 'uiSrc/components/notifications/success-messages'
//   import { INFINITE_MESSAGES } from 'uiSrc/components/notifications/components/infinite-messages/InfiniteMessages'
//   import { stringToBuffer } from 'uiSrc/utils/formatters/bufferFormatters'
//   import { CloudJobName, CloudJobStep } from 'uiSrc/electron/constants'
//   import { store } from 'uiSrc/slices/store'
if (process.env.NODE_ENV === 'development') {
  const buf = (s: string) => stringToBuffer(s)
  const noop = () => {}

  const successArgs: Record<string, any[]> = {
    ADDED_NEW_INSTANCE: ['My Database'],
    ADDED_NEW_RDI_INSTANCE: ['My RDI Instance'],
    DELETE_INSTANCE: ['My Database'],
    DELETE_RDI_INSTANCE: ['My RDI Instance'],
    DELETE_INSTANCES: [['db-1', 'db-2', 'db-3']],
    DELETE_RDI_INSTANCES: [['rdi-1', 'rdi-2']],
    ADDED_NEW_KEY: [buf('user:1')],
    DELETED_KEY: [buf('user:1')],
    REMOVED_KEY_VALUE: [buf('myhash'), buf('field1'), 'Field'],
    REMOVED_LIST_ELEMENTS: [buf('mylist'), 3, [buf('a'), buf('b'), buf('c')]],
    INSTALLED_NEW_UPDATE: ['2.60.0', noop],
    MESSAGE_ACTION: ['1526984818136-0', 'acknowledged'],
    NO_CLAIMED_MESSAGES: [],
    CREATE_INDEX: [],
    DELETE_INDEX: ['idx:products'],
    TEST_CONNECTION: [],
    UPLOAD_DATA_BULK: [
      { summary: { processed: 100, succeed: 98, failed: 2 }, duration: 1234 },
      'commands.txt',
    ],
    DELETE_LIBRARY: ['myLibrary'],
    ADD_LIBRARY: ['myLibrary'],
    REMOVED_ALL_CAPI_KEYS: [],
    REMOVED_CAPI_KEY: ['My API Key'],
    DATABASE_ALREADY_EXISTS: [],
    SUCCESS_RESET_PIPELINE: [],
    SUCCESS_TAGS_UPDATED: [],
    AZURE_AUTH_SUCCESS: ['user@example.com'],
  }
  const testSuccess: any = (name: string) =>
    store.dispatch(
      addMessageNotification((successMessages as any)[name](...(successArgs[name] || []))),
    )
  testSuccess.keys = Object.keys(successArgs)
  testSuccess.all = () =>
    testSuccess.keys.forEach((n: string, i: number) => setTimeout(() => testSuccess(n), i * 1500))
  ;(window as any).__testSuccess = testSuccess

  const infiniteArgs: Record<string, any[]> = {
    AUTHENTICATING: [],
    PENDING_CREATE_DB: [CloudJobStep.Credentials],
    SUCCESS_CREATE_DB: [{ provider: 'AWS', region: 'us-east-1' }, noop, CloudJobName.CreateFreeDatabase],
    DATABASE_EXISTS: [noop, noop],
    DATABASE_IMPORT_FORBIDDEN: [noop],
    SUBSCRIPTION_EXISTS: [noop, noop],
    AUTO_CREATING_DATABASE: [],
    APP_UPDATE_AVAILABLE: ['2.60.0', noop],
    SUCCESS_DEPLOY_PIPELINE: [],
  }
  const testInfinite: any = (name: string) =>
    store.dispatch(
      addInfiniteNotification((INFINITE_MESSAGES as any)[name](...(infiniteArgs[name] || []))),
    )
  testInfinite.keys = Object.keys(infiniteArgs)
  testInfinite.all = () =>
    testInfinite.keys.forEach((n: string, i: number) => setTimeout(() => testInfinite(n), i * 1800))
  ;(window as any).__testInfinite = testInfinite
}

Then in the browser console:

__testSuccess.keys              // list every success factory
__testSuccess('UPLOAD_DATA_BULK')
__testSuccess.all()             // cycle all success toasts (~1.5s apart)

__testInfinite('SUCCESS_CREATE_DB')
__testInfinite.all()            // cycle all infinite toasts (~1.8s apart)

Append ?lang=bg to verify Bulgarian. (Infinite toasts are persistent — close
them between triggers, or they stack.)


Before / After

Success notifications

Factory Case EN BG
ADDED_NEW_INSTANCE / DELETE_INSTANCE Database added / deleted (bold name) Screenshot 2026-06-29 at 13 42 46Screenshot 2026-06-29 at 13 43 33Screenshot 2026-06-29 at 13 44 00Screenshot 2026-06-29 at 13 45 14 Screenshot 2026-06-29 at 13 43 01Screenshot 2026-06-29 at 13 43 20Screenshot 2026-06-29 at 13 44 11Screenshot 2026-06-29 at 13 45 27
ADDED_NEW_RDI_INSTANCE / DELETE_RDI_INSTANCE RDI instance added / deleted Screenshot 2026-06-29 at 13 44 34Screenshot 2026-06-29 at 13 43 33 Screenshot 2026-06-29 at 13 44 24Screenshot 2026-06-29 at 13 43 20
DELETE_INSTANCES / DELETE_RDI_INSTANCES Bulk delete (count + list) Screenshot 2026-06-29 at 13 46 00 Screenshot 2026-06-29 at 13 45 51
ADDED_NEW_KEY / DELETED_KEY Key added / deleted Screenshot 2026-06-29 at 13 46 17 Screenshot 2026-06-29 at 13 46 26
REMOVED_KEY_VALUE / REMOVED_LIST_ELEMENTS Value / elements removed Screenshot 2026-06-29 at 13 46 43Screenshot 2026-06-29 at 13 46 56Screenshot 2026-06-29 at 13 47 59 Screenshot 2026-06-29 at 13 46 35Screenshot 2026-06-29 at 13 47 05Screenshot 2026-06-29 at 13 47 52
CREATE_INDEX / DELETE_INDEX Index created / deleted Screenshot 2026-06-29 at 13 59 41Screenshot 2026-06-29 at 13 59 50 Screenshot 2026-06-29 at 13 59 34Screenshot 2026-06-29 at 13 59 59
ADD_LIBRARY / DELETE_LIBRARY Library added / deleted Screenshot 2026-06-29 at 14 01 59Screenshot 2026-06-29 at 14 02 15 Screenshot 2026-06-29 at 14 01 47Screenshot 2026-06-29 at 14 02 24
MESSAGE_ACTION Message claimed / acknowledged Screenshot 2026-06-29 at 13 58 33 Screenshot 2026-06-29 at 13 58 45
NO_CLAIMED_MESSAGES No messages claimed Screenshot 2026-06-29 at 13 59 11 Screenshot 2026-06-29 at 13 59 21
INSTALLED_NEW_UPDATE App updated (Release Notes link) Screenshot 2026-06-29 at 13 48 08 Screenshot 2026-06-29 at 13 51 17
REMOVED_ALL_CAPI_KEYS / REMOVED_CAPI_KEY API key(s) removed Screenshot 2026-06-29 at 14 02 42Screenshot 2026-06-29 at 14 02 50 Screenshot 2026-06-29 at 14 02 34Screenshot 2026-06-29 at 14 03 01
TEST_CONNECTION Connection successful Screenshot 2026-06-29 at 14 00 18 Screenshot 2026-06-29 at 14 00 09
DATABASE_ALREADY_EXISTS Database already exists Screenshot 2026-06-29 at 14 03 24 Screenshot 2026-06-29 at 14 04 37
SUCCESS_RESET_PIPELINE / SUCCESS_TAGS_UPDATED Pipeline reset / tags updated Screenshot 2026-06-29 at 14 07 33 Screenshot 2026-06-29 at 14 07 25
AZURE_AUTH_SUCCESS Azure auth successful Screenshot 2026-06-29 at 14 07 43 Screenshot 2026-06-29 at 14 09 06
UPLOAD_DATA_BULK Bulk upload summary Screenshot 2026-06-29 at 14 01 03 Screenshot 2026-06-29 at 14 16 35

Infinite notifications

Factory Case EN BG
AUTHENTICATING Authenticating… Screenshot 2026-06-29 at 14 27 42 Screenshot 2026-06-29 at 14 27 35
PENDING_CREATE_DB Create-DB progress steps Screenshot 2026-06-29 at 14 27 57 Screenshot 2026-06-29 at 14 28 10
SUCCESS_CREATE_DB DB ready (Notice, details, Manage DB / Connect) Screenshot 2026-06-29 at 14 28 38 Screenshot 2026-06-29 at 14 28 30
DATABASE_EXISTS Import existing DB? (Import) Screenshot 2026-06-29 at 14 28 50 Screenshot 2026-06-29 at 14 29 00
SUBSCRIPTION_EXISTS Create free DB? (Create) Screenshot 2026-06-29 at 14 31 16 Screenshot 2026-06-29 at 14 31 07
DATABASE_IMPORT_FORBIDDEN Import disabled (Redis Cloud link, OK) Screenshot 2026-06-29 at 14 30 43 Screenshot 2026-06-29 at 14 30 52
APP_UPDATE_AVAILABLE New version ({{version}}, Restart) Screenshot 2026-06-29 at 14 32 02 Screenshot 2026-06-29 at 14 31 50
SUCCESS_DEPLOY_PIPELINE Pipeline deployed Screenshot 2026-06-29 at 14 32 12 Screenshot 2026-06-29 at 14 33 13

Part of RI-8268

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


Note

Low Risk
Presentation-only i18n with a small hardening change for Trans interpolation; call sites already use the new MESSAGE_ACTION signature.

Overview
This PR localizes persistent/in-progress and success toasts by replacing hardcoded English in InfiniteMessages.tsx and success-messages.tsx with i18n.t / Trans, and adds matching notification.infinite.* and notification.success.* strings in en.json and bg.json.

Rich copy (bold names, Redis Cloud / Release Notes links, inactivity notice) now uses Trans component slots instead of inline JSX. MESSAGE_ACTION takes a message id plus a typed claimed | acknowledged action so the verb can be translated separately.

escapeTrans escapes user-controlled names/ids before they go into <Trans> markup, reducing accidental HTML injection when escapeValue is off. Bulk-upload stat labels get whiteSpace: 'nowrap' for longer translated text.

Reviewed by Cursor Bugbot for commit 042c0a2. Bugbot is set up for automated code reviews on this repo. Configure here.

@valkirilov valkirilov changed the title RI-8268 [i18n] Frontend: translate success & infinite notifications (round 2) RI-8268 Translate success & infinite notifications (round 2) Jun 29, 2026
@jit-ci

jit-ci Bot commented Jun 29, 2026

Copy link
Copy Markdown

🛡️ Jit Security Scan Results

CRITICAL HIGH MEDIUM

✅ No security findings were detected in this PR


Security scan by Jit

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Code Coverage - Integration Tests

Status Category Percentage Covered / Total
🟡 Statements 79.12% 18070/22838
🟡 Branches 61.88% 8375/13534
🟡 Functions 66.86% 2448/3661
🟡 Lines 78.73% 17008/21602

@valkirilov valkirilov marked this pull request as ready for review June 29, 2026 12:07
@valkirilov valkirilov requested a review from a team as a code owner June 29, 2026 12:07
Comment thread redisinsight/ui/src/i18n/locales/bg.json

@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: f32a2da63b

ℹ️ 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/notifications/success-messages.tsx Outdated
Comment thread redisinsight/ui/src/i18n/locales/bg.json
pawelangelow
pawelangelow previously approved these changes Jun 29, 2026

@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: b5ffaae178

ℹ️ 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/notifications/success-messages.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: 403254f8ae

ℹ️ 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/notifications/success-messages.tsx
@valkirilov valkirilov self-assigned this Jul 1, 2026
@valkirilov valkirilov force-pushed the fe/RI-8268/translate-error-messages branch from 779312a to 62958ea Compare July 2, 2026 09:45
@valkirilov valkirilov force-pushed the fe/RI-8268/translate-success-infinite branch from 403254f to 12f1111 Compare July 2, 2026 09:55

@cursor cursor 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.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ 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 12f1111. Configure here.

Comment thread redisinsight/ui/src/components/notifications/success-messages.tsx
@valkirilov valkirilov force-pushed the fe/RI-8268/translate-success-infinite branch from 12f1111 to 1a6659f Compare July 2, 2026 11:43
Base automatically changed from fe/RI-8268/translate-error-messages to main July 2, 2026 11:56
@valkirilov valkirilov dismissed pawelangelow’s stale review July 2, 2026 11:56

The base branch was changed.

valkirilov and others added 4 commits July 2, 2026 15:00
Migrate success-messages.tsx factories to i18n (notification.success.* keys),
using the i18n singleton + <Trans> for bold names, the Release Notes link, and
{{total}} counts. MESSAGE_ACTION now resolves its action word (claimed/
acknowledged) through i18n so the whole toast localizes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Migrate INFINITE_MESSAGES to i18n (notification.infinite.* keys) via the i18n
singleton + <Trans> for the bold Notice and inline Redis Cloud link, with a
button.* segment for the action labels (Manage DB, Connect, Import, OK, Create,
Restart). Keys re-sorted to i18next-cli's canonical order via i18n:extract.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The value type (Member/Field/Group/Entry/Element/Consumer/JSON key) was an
English literal interpolated into the title, producing mixed-language Bulgarian
toasts. Add a per-type title key for each so it reads correctly and agrees in
gender in Bulgarian.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
<Trans> parses interpolated values as markup (escapeValue is off), so a Redis
key/name containing e.g. "<br/>" was rendered as a tag instead of literal text.
Escape the user-provided values before interpolating them.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@valkirilov valkirilov force-pushed the fe/RI-8268/translate-success-infinite branch from 1a6659f to 042c0a2 Compare July 2, 2026 12:03
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Code Coverage - Frontend unit tests

St.
Category Percentage Covered / Total
🟢 Statements 83.53% 26452/31668
🟡 Branches 69.13% 11227/16240
🟡 Functions 78.83% 7085/8988
🟢 Lines 84% 25783/30694

Test suite run success

7491 tests passing in 842 suites.

Report generated by 🧪jest coverage report action from 042c0a2

@valkirilov valkirilov merged commit 661d6cc into main Jul 2, 2026
22 checks passed
@valkirilov valkirilov deleted the fe/RI-8268/translate-success-infinite branch July 2, 2026 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants