Skip to content

fix(desktop): localize the Bot Mode group row's member count and availability - #108979

Closed
vadimcomanescu wants to merge 1 commit into
NousResearch:mainfrom
vadimcomanescu:fix/desktop-group-row-member-count-i18n
Closed

vadimcomanescu wants to merge 1 commit into
NousResearch:mainfrom
vadimcomanescu:fix/desktop-group-row-member-count-i18n

Conversation

@vadimcomanescu

Copy link
Copy Markdown
Contributor

What does this PR do?

The Bot Mode group row spelled its empty-room preview (${members.length} bots) and its accessible name (${group}, ${members.length} bots, ${available} of ${total} available) as English literals, so a reader on ja, zh or zh-hant saw English in a row whose neighbours were translated, and a screen reader read English for the room the group chat pane names in the active language. The bundle already carries group.memberCount in all four locales (a7db531 moved it there) and group-chat-view.tsx renders through it; the row's rebuild (5afa487) reintroduced the literal next to the useBots() accessor the component already holds.

The preview and the aria-label's count now go through group.memberCount. The availability sentence had no key, so group.availableCount(available, total) is added in en, ja, zh and zh-hant, for the aria-label and the tooltip that share it. 'You' in the last-message preview stays a literal on purpose: it is the persisted author sentinel the bundle's header describes.

Related Issue

Fixes #108978

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

  • apps/desktop/src/plugins/hermes-bots/bot-row.tsx: GroupRow renders the preview and the aria-label's count with b.group.memberCount, and the availability sentence with b.group.availableCount.
  • apps/desktop/src/plugins/hermes-bots/i18n.ts: group.availableCount(available, total) in the type and in all four bundles.
  • apps/desktop/src/plugins/hermes-bots/i18n-test-helper.ts: translateBotsIn(locale); translateBots is translateBotsIn('en'), unchanged for existing callers.
  • apps/desktop/src/plugins/hermes-bots/bot-row.test.tsx: the mock resolves against a chosen locale; one new case renders the same group row under en and ja and reads the preview and the button's accessible name.

How to Test

  1. cd apps/desktop && npx vitest run --project ui src/plugins/hermes-bots/bot-row.test.tsx. Observed: 8 passed.
  2. Revert only bot-row.tsx and rerun. Observed: the new case fails on the Japanese preview (ボット3体 not found), so it pins the fix rather than restating it.
  3. npx tsc -p . --noEmit, npx eslint and npx prettier --check on the four files. Observed: clean.
  4. Manual: switch the desktop to 日本語, open Bot Mode with an empty group; the row's second line reads ボット3体 and the accessibility inspector shows the localized name.

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: Arch Linux, Node v24.18.0

The change is desktop TypeScript only, so I ran the affected Vitest file and the desktop typecheck and lint rather than the Python suite.

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — N/A, no documented surface changes
  • I've updated cli-config.yaml.example if I added/changed config keys — N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — renderer strings only, no platform-specific code
  • I've updated tool descriptions/schemas if I changed tool behavior — N/A

Screenshots / Logs

$ npx vitest run --project ui src/plugins/hermes-bots/bot-row.test.tsx
 Test Files  1 passed (1)
      Tests  8 passed (8)

# with bot-row.tsx reverted:
 FAIL  |ui| src/plugins/hermes-bots/bot-row.test.tsx > a group row > previews an empty room and describes it to assistive tech in the active language
      Tests  1 failed | 7 passed (8)

…lability

The group row's empty-room preview and its aria-label spelled
`${members.length} bots` and `${available} of ${total} available` as
literals, so a reader on ja, zh or zh-hant saw English in a row whose
neighbours were translated. The bundle already carries `group.memberCount`
in all four locales (a7db531 moved it there) and `group-chat-view.tsx`
renders through it; the row's rebuild (5afa487) reintroduced the literal
next to the bundle accessor it already holds.

Route both through the bundle: the preview and the aria-label's count use
`group.memberCount`, and a new `group.availableCount(available, total)`
carries the availability sentence in all four locales, for the aria-label
and the tooltip that share it. `'You'` in the last-message preview stays a
literal on purpose: it is the persisted author sentinel the bundle header
describes.

Tests: `i18n-test-helper` gains `translateBotsIn(locale)`, since a case that
has to tell a catalog string from an English literal cannot do it under
`en`. The new group-row case renders the same row under `en` and `ja` and
reads the preview and the accessible name; it fails on the previous source.
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/desktop Electron desktop app (apps/desktop/*) labels Sep 13, 2026
@teknium1

Copy link
Copy Markdown
Collaborator

Thanks @vadimcomanescu — this landed on main through #113430 (fix(bot-mode): roster menu and group row speak the active language (#91667, #108978, salva), merged as 4d46d76. Your commits/analysis were carried in with credit (see that PR's body and Co-authored-by trailers); the salvage rebased onto current main, widened to sibling surfaces where the review found gaps, and was live-verified in the real Electron app. Closing this one as superseded — thank you for the fix.

@teknium1 teknium1 closed this Sep 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/desktop Electron desktop app (apps/desktop/*) P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Bot Mode group row shows its member count and availability in English in every language

3 participants