fix(chat): translate the tool-call propose-plan card - #5100
Merged
Conversation
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
enabled auto-merge (squash)
July 23, 2026 16:02
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 throughuseT()and thechat.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 existingchat.proposePlan.implementationPlankey (identical copy/meaning to the sibling component) and added three new keys —chat.proposePlan.approved,chat.proposePlan.rejected,chat.proposePlan.viewPlan— to bothi18n/en/chat.tsandi18n/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) andcd apps/mesh && bunx tsc --noEmit(green, confirmsen/chat.ts/pt-br/chat.tsstay in sync via thesatisfies 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.
useT()in the tool-callProposePlanPart.chat.proposePlan.implementationPlan; addchat.proposePlan.approved,chat.proposePlan.rejected,chat.proposePlan.viewPlan.apps/mesh/src/web/i18n/en/chat.tsandapps/mesh/src/web/i18n/pt-br/chat.tswith the new keys.Written for commit 2b6533a. Summary will update on new commits.