Skip to content

fix(chat): translate the tool-call propose-plan card - #5100

Merged
pedrofrxncx merged 1 commit into
mainfrom
fix/propose-plan-tool-call-i18n-w8
Jul 23, 2026
Merged

fix(chat): translate the tool-call propose-plan card#5100
pedrofrxncx merged 1 commit into
mainfrom
fix/propose-plan-tool-call-i18n-w8

Conversation

@pedrofrxncx

@pedrofrxncx pedrofrxncx commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Source: hardening follow-up — CLAUDE.md's i18n rule ("Never hardcode user-facing strings in apps/mesh/src/web") is violated in apps/mesh/src/web/components/chat/message/parts/tool-call-part/propose-plan.tsx. Its sibling component, apps/mesh/src/web/components/chat/highlight/propose-plan.tsx, already renders the same "Implementation Plan" title through useT() and the chat.proposePlan.* i18n dictionary — this second propose-plan card (rendered for the tool-call part in the thread, gating the approve/reject UI) was left hardcoded in English ("Implementation Plan", "Approved", "Rejected", "View plan"), so pt-br users see English copy here while the rest of the plan UI is translated.

Payoff: keeps the two propose-plan surfaces consistent for pt-br users, and closes a concrete, repo-documented i18n convention gap rather than leaving it to rot.

Fix: added useT() (called before the component's early return, so the hook order stays unconditional), replaced the four hardcoded strings, reused the existing chat.proposePlan.implementationPlan key (identical copy/meaning to the sibling component) and added three new keys — chat.proposePlan.approved, chat.proposePlan.rejected, chat.proposePlan.viewPlan — to both i18n/en/chat.ts and i18n/pt-br/chat.ts.

Reviewer check: open a thread where an agent used the plan tool-call (approve or reject a plan) with the UI language set to pt-BR (Settings → Preferences) and confirm the card now shows "Plano de Implementação" / "Aprovado" / "Rejeitado" / "Ver plano" instead of English.

Verified locally: bun run fmt (clean) and cd apps/mesh && bunx tsc --noEmit (green, confirms en/chat.ts/pt-br/chat.ts stay in sync via the satisfies Record<keyof typeof enChat, string> check). No existing test covers this file. Full CI runs lint/tests.


Summary by cubic

Localized the tool-call propose-plan card by replacing hardcoded English strings with i18n keys, matching the highlight component. pt-BR users now see translated labels for the plan title, status, and “view plan” link.

  • Bug Fixes
    • Use useT() in the tool-call ProposePlanPart.
    • Replace strings with i18n keys: reuse chat.proposePlan.implementationPlan; add chat.proposePlan.approved, chat.proposePlan.rejected, chat.proposePlan.viewPlan.
    • Update apps/mesh/src/web/i18n/en/chat.ts and apps/mesh/src/web/i18n/pt-br/chat.ts with the new keys.

Written for commit 2b6533a. Summary will update on new commits.

Review in cubic

The message-part propose-plan card (ProposePlanPart, used for the
approve/reject tool-call in the thread) hardcoded "Implementation Plan",
"Approved", "Rejected" and "View plan" in English, unlike its sibling
highlight/propose-plan.tsx which already goes through i18n for the same
"Implementation Plan" copy. Wires it up to useT(), reusing the existing
chat.proposePlan.implementationPlan key and adding approved/rejected/viewPlan
(en + pt-br).
@pedrofrxncx
pedrofrxncx enabled auto-merge (squash) July 23, 2026 16:02
@pedrofrxncx
pedrofrxncx merged commit 2938419 into main Jul 23, 2026
14 checks passed
@pedrofrxncx
pedrofrxncx deleted the fix/propose-plan-tool-call-i18n-w8 branch July 23, 2026 16:10
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