Skip to content

feat(i18n): migrate browser key-details framework to i18n (RI-8274) - #6287

Open
valkirilov wants to merge 3 commits into
mainfrom
feature/RI-8274-i18n-key-details-framework
Open

feat(i18n): migrate browser key-details framework to i18n (RI-8274)#6287
valkirilov wants to merge 3 commits into
mainfrom
feature/RI-8274-i18n-key-details-framework

Conversation

@valkirilov

@valkirilov valkirilov commented Jul 24, 2026

Copy link
Copy Markdown
Member

Summary

Routes all user-facing strings in the key-details framework layer through t() with flat browser.keyDetails.* keys, filled in both en.json and bg.json (Bulgarian).

This is the framework/chrome scope only - per-type value editors (hash/list/set/zset/string/rejson and stream/array/vector-set) follow in PRs C and D.

What's migrated

Header (key-details-header/*) - close/delete/copy aria, key-name & TTL tooltips, production rename/change-TTL confirm dialogs (<Trans>), size/length/quant/vectorDim/count labels, 14 formatter labels, and LENGTH_NAMING_BY_TYPE.

Shared widgets (key-details/shared/*) - PreviewToggle, CommandPreview, and the three editable widgets (EditableInput/EditablePopover/EditableTextArea): shared production-write confirm trio, edit aria, textarea placeholder, form Cancel/Save.

Fallback chrome - NoKeySelected, TextDetailsWrapper (shared close chrome), TooLongKeyNameDetails, UnsupportedTypeDetails (<Trans> repo link), ModulesTypeDetails (interpolated title + <Trans> Workbench link).

key-details-actions/* needs no changes - those components are purely prop-driven and carry no literal strings (their titles come from the per-type editors in PR C/D).


Note

Low Risk
Presentation-only i18n wiring with no changes to Redis commands or data mutation logic; minor risk of missing translation keys or regressions in production confirmation copy.

Overview
Internationalizes the browser key-details chrome (header, shared widgets, and fallback panels) by routing user-facing copy through t() / <Trans> with new flat browser.keyDetails.* keys in en and bg.

Header — close/delete aria and tooltips; rename and TTL production confirmations with interpolated names; size/length/quant/vector/count labels; value-formatter options now store i18n keys (ParseKeys) resolved at render time; LENGTH_NAMING_BY_TYPE likewise maps key types to browser.keyDetails.length.* keys.

SharedPreviewToggle, CommandPreview, and editable input/popover/textarea flows use translated preview labels and the shared production-write confirm strings (Cancel/Save, edit aria, placeholder).

Fallback views — empty state, text wrapper close chrome, too-long name, unsupported type (repo link via <Trans>), and module keys (Workbench link + {{moduleName}} title).

Per-type value editors are out of scope for this PR; PreviewToggle.spec now uses inline English expectations instead of removed string constants.

Reviewed by Cursor Bugbot for commit 57d59b3. 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 24, 2026 10:47
@valkirilov valkirilov self-assigned this Jul 24, 2026

@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 03efa32. Configure here.

<Trans
i18nKey="browser.keyDetails.ttl.changeConfirm.description"
values={{
name: escapeTrans(`${keyProp}`),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Null key name renders as literal "null" string

Low Severity

When keyProp (nameString) is null (e.g. for binary/unprintable key names), escapeTrans(\${keyProp}`)coerces it to the literal string"null", so the confirmation dialog displays **null** as the key name. The old JSX {keyProp}renderednullas empty. The rename dialog inKeyDetailsHeaderNameavoids this with an explicit!isNull(keyProp)guard, but the TTL dialog's guard only checkskeyBuffer`.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 03efa32. Configure here.

Route the key-details header through t() under browser.keyDetails.*,
filling en and bg (PR B, commit 1 of 4).

- header shell (close), name (tooltip/copy + prod-rename confirm),
  TTL (placeholder + prod-change confirm), size/length (size, length
  naming, quant/vector-dim/count), delete aria
- formatter dropdown: 14 labels via a ParseKeys-typed config (bg keeps
  technical format names, translates the descriptive ones)
- LENGTH_NAMING_BY_TYPE (constants/keys.ts, consumed only here) → i18n
  key values + a length.default fallback
- rename/change-TTL confirmations use <Trans> with bold interpolation
@valkirilov
valkirilov force-pushed the feature/RI-8274-i18n-key-details-framework branch from 03efa32 to 57d59b3 Compare July 27, 2026 13:18
@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage - Frontend unit tests

St.
Category Percentage Covered / Total
🟢 Statements 83.35% 28204/33837
🟡 Branches 69.44% 11995/17275
🟡 Functions 78.33% 7474/9542
🟢 Lines 83.81% 27442/32742

Test suite run success

7878 tests passing in 870 suites.

Report generated by 🧪jest coverage report action from 57d59b3

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