Skip to content

feat(ui): i18n - migrate shared constants, base components, and app chrome - #6423

Open
valkirilov wants to merge 9 commits into
mainfrom
fe/feature/RI-8364/i18n-shared-constants-base-components
Open

feat(ui): i18n - migrate shared constants, base components, and app chrome#6423
valkirilov wants to merge 9 commits into
mainfrom
fe/feature/RI-8364/i18n-shared-constants-base-components

Conversation

@valkirilov

@valkirilov valkirilov commented Aug 19, 2026

Copy link
Copy Markdown
Member

What changed

Many parts of the app were hardcoded in English and would not switch when a user changed the language. This PR wires those pieces up to the translation system so they follow the active language like everything else.

Covers buttons, tooltips, placeholders, headings, and status messages across the navigation bar, database header, auto-refresh control, file picker, import modal, Workbench code blocks, and the EULA/privacy settings screen.

Also deleted a file that existed in the codebase but was never used.

References: #RI-8364


Note

Low Risk
Presentation-layer i18n and string centralization with no auth, data, or API behavior changes beyond a minor telemetry payload tweak for tab identifiers.

Overview
Replaces hardcoded English UI copy with i18next (useTranslation, Trans, and i18n.t where hooks are unavailable) across shared components and app chrome: auto-refresh, file picker, navigation, instance headers, consents/EULA, import modals, Workbench code blocks, item-list actions, and related browser key-detail tooltips.

Constants are refactored for localization: validationErrors becomes getValidationErrors(t) at call sites; form/import table headers and several browser-only message constants move to locale keys (e.g. browser.keyDetails.truncatedActionDisabled, stream “name too long” strings). AI chat error helpers and markdown Redis Cloud fallback text use i18n.t. Unused breadcrumbs.ts is removed.

Home tabs labels come from getTabs(t); tab-change telemetry now sends the stable tab.value (e.g. rdi-instances) instead of the translated label. Matching spec update included.

en and bg locale files gain the new keys (common.button.*, navigation.*, autoRefresh.*, etc.).

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

Route hardcoded English strings in shared constants through t() so
already-migrated screens render in the active locale.

- getValidationErrors(t) factory replacing the default export (11 consumers updated)
- AI_CHAT_ERRORS uses i18n singleton instead of bare strings
- Remove TEXT_* consts from browser.ts (inlined at call sites via t())
- Drop TABLE_IMPORT_RESULT_COLUMN_ID_HEADER_MAP (built with t() in TableResult)
- Delete breadcrumbs.ts (dead code, zero consumers)
- Add 15 new keys to en.json + bg.json
- Update .tscheck.rec.json baselines for pre-existing TS errors

References: #RI-8364
Route hardcoded strings in RiFilePicker and AutoTag through t()
so these shared components render in the active locale.

- RiFilePicker: prompt text, file-count, aria-label, Remove button
- AutoTag: Clear button title
- Add common.button.{clear,remove} and common.filePicker.* keys

Also fix 4 pre-existing prettier violations in HashDetailsTable.spec.tsx
(long toHaveTextContent lines, same pattern fixed elsewhere in Chunk 1).

References: #RI-8364
Route hardcoded strings in app-chrome navigation and header components
through t() so they render in the active locale.

- NavigationMenu: aria-label, GitHub tooltip
- useNavigation: all nav-item tooltip + ariaLabel strings (navigation.page.*)
- InstanceHeader: breadcrumb link, tooltip, aria-label, db index placeholder
- ShortInstanceInfo: database info alt, logical db section, user default, modules heading
- home-tabs/constants: static tabs array replaced with getTabs(t) factory
- RdiInstanceHeader: tooltip, aria-label, breadcrumb link text
- Add 31 keys across homeTabs.*, instanceHeader.*, navigation.*, rdiInstanceHeader.*

References: #RI-8364
Routes hardcoded strings in AutoRefresh, TableColumnSearch,
ConnectivityError, GroupBadge, ActionBar, DeleteAction, and
ExportAction through t(). Adds 20 new keys across autoRefresh.*,
common.button.*, common.search.*, and itemList.* namespaces
to en.json and bg.json.

References: #RI-8364
Routes remaining hardcoded English strings through t() in markdown
code blocks, the redis upload button, the import file modal, and
the consents settings/popup. Uses Trans component for the EULA
agreement sentence with inline links.

References: #RI-8364
@valkirilov
valkirilov requested a review from a team as a code owner August 19, 2026 11:07
@valkirilov valkirilov self-assigned this Aug 19, 2026
Comment thread redisinsight/ui/src/constants/validationErrors.ts

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

ℹ️ 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/.tscheck.rec.json Outdated
Comment thread redisinsight/ui/src/components/home-tabs/HomeTabs.tsx
Comment thread redisinsight/ui/src/constants/validationErrors.ts
Comment thread redisinsight/ui/src/components/auto-refresh/AutoRefresh.tsx
TypeScript infers the state type as never when useState is initialized
with a lazy i18n t() call, causing a type error on the setter.

References: #RI-8364

@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 high effort and found 3 potential issues.

There are 4 total unresolved issues (including 1 from previous review).

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 27661f0. Configure here.

Comment thread redisinsight/ui/src/components/auto-refresh/utils.ts
Comment thread redisinsight/ui/src/components/auto-refresh/AutoRefresh.tsx
Comment thread redisinsight/ui/src/components/home-tabs/HomeTabs.tsx
The Chunk 1 tscheck run on macOS recorded 10 extra platform-specific
TS2769/TS2345 errors in unrelated browser/virtual-grid files. CI
(Ubuntu) does not see these, so the baseline was 10 higher than it
should be. Restore to the Linux-accurate count (1287).

References: #RI-8364

@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: 08d4979113

ℹ️ 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/auto-refresh/utils.ts
Comment thread redisinsight/ui/src/constants/apiErrors.ts
@github-actions

github-actions Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Code Coverage - Frontend unit tests

St.
Category Percentage Covered / Total
🟢 Statements 83.58% 28879/34551
🟡 Branches 69.67% 12274/17618
🟡 Functions 78.66% 7626/9695
🟢 Lines 84.05% 28072/33401

Test suite run success

8042 tests passing in 872 suites.

Report generated by 🧪jest coverage report action from be273b4

tab.label is now a translated string; sending it to analytics would
split the same action across locales. Use tab.value ('databases' /
'rdi-instances') which is locale-independent.

References: #RI-8364
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.

1 participant