Skip to content

fix(i18n): localize built-in tool names - #4010

Open
Colafornia wants to merge 2 commits into
apache:mainfrom
Colafornia:fix/locale-aware-tool-presentation
Open

fix(i18n): localize built-in tool names#4010
Colafornia wants to merge 2 commits into
apache:mainfrom
Colafornia:fix/locale-aware-tool-presentation

Conversation

@Colafornia

Copy link
Copy Markdown
Contributor

Summary

Built-in tool names can display persisted labels from a different locale. Existing session history can therefore show Chinese labels in English mode or fixed English labels in Chinese mode.

Resolve Maka-owned tool names from the active UI locale instead. Group each tool's translations in one typed table so every supported locale requires a label.

Preserve provider labels for external tools and fall back to their canonical identifiers. Keep the product binding catalog unchanged.

Refs #3962

Verification

  • npm --workspace @maka/ui test — 234 tests passed
  • npm --workspace @maka/core run build — passed
  • Full runtime tests were blocked during compilation by unrelated Slack dependency and HttpsProxyAgent type errors

AI use

Select exactly one:

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: OpenAI Codex helped inspect the implementation, revise the locale boundary, update tests, and draft this PR.

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No

@Colafornia
Colafornia marked this pull request as draft August 27, 2026 10:28
@github-actions github-actions Bot added the effort/M Under 500 readable lines label Aug 27, 2026
@Colafornia
Colafornia force-pushed the fix/locale-aware-tool-presentation branch 4 times, most recently from 8c1e6a6 to 5452ebe Compare August 28, 2026 06:53
@Colafornia
Colafornia marked this pull request as ready for review August 28, 2026 06:55
@github-actions github-actions Bot added effort/L Under 1000 readable lines and removed effort/M Under 500 readable lines labels Aug 28, 2026

@Astro-Han Astro-Han left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed at exact head 5452ebeebf692b1dfd4875772a4851748e3b421c. Approving with comments (P2 only).

Built-in presentation now resolves from the active UI locale instead of whatever displayName was persisted; external/MCP provider labels are preserved. BUILTIN_TOOL_LABELS + getBuiltinToolLabel / resolveToolName / resolveToolDisplayName is the right split. Core search no longer owns Chinese formatSearchResultSummary; Desktop formats via formatThreadSearchResultSummary, and SearchHistory uses English wire names. Thread search still indexes tool intent only, so localized labels are not searchable — same as before, and the right call.

Locale completeness for listed tools is compile-time (Record<UiLocale, string> against UI_LOCALES = zh | en). Catalog membership is only a unit test.

[P2] Close BUILTIN_TOOL_LABELS over a catalog name union so the next MAKA_CATALOG_TOOLS row cannot silently revive persisted-locale labels.

[P2] Derive BUILTIN_PROXY_PREFIXES from the desktop offer IDs (desktop_browser, desktop_computer_use, desktop_settings, desktop_rive) or pin them with a contract test. Browser/Rive still persist zh displayName.

CI on this SHA is green. Not blocking.

Comment thread packages/ui/src/tool-activity/copy.ts Outdated
Comment thread packages/ui/src/tool-activity/display-name.ts Outdated
@Astro-Han

Copy link
Copy Markdown
Contributor

Need a rebase~

Resolve Maka-owned tool labels from the active UI locale while preserving
provider and compatibility labels for non-localized consumers. Move thread
search metadata presentation out of Core so historical results follow the
current locale.

Refs apache#3962

Generated-by: OpenAI Codex
@Colafornia
Colafornia force-pushed the fix/locale-aware-tool-presentation branch from 8003ad4 to cabddd8 Compare August 28, 2026 15:56
@Colafornia
Colafornia force-pushed the fix/locale-aware-tool-presentation branch from cabddd8 to 9e369c1 Compare August 28, 2026 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/L Under 1000 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants