feat: add localized plugin metadata and resource menus#4082
Conversation
Add optional locale maps for plugin metadata, config field descriptions, and management resource menu labels. These SDK fields let plugins expose translated display data without changing existing callers when locales are omitted.
Parse, trim, normalize, and deduplicate localized plugin store metadata. Preserve locales in generated install manifests and expose the SDK alias so embedders can consume localized registry entries.
Resolve preferred locales from query, X-Locale, and Accept-Language, then forward them to plugin management and resource handlers. Localize plugin store and installed plugin display fields while keeping resource launch URLs navigable with default query parameters.
There was a problem hiding this comment.
Code Review
This pull request introduces comprehensive localization (i18n) support for plugins, updating the plugin store, manifests, registries, and metadata to handle localized display fields. It adds a new plugini18n package to manage locale normalization, preferred locale resolution from request headers/queries, and fallback lookups. The feedback recommends improving the localeCandidates function to progressively strip subtags from right to left, ensuring full support for standard BCP 47 progressive fallback (e.g., falling back from zh-Hant-HK to zh-Hant and then zh).
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 409e0531ea
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Resolve locale matches by progressively stripping subtags from right to left. This lets requests such as zh-Hant-HK match an available zh-Hant translation before falling back to zh.
Summary
This adds localization support for plugin-facing metadata across the plugin store, SDK schemas, and management/resource menu surfaces.
Background
Plugin display data currently has a single language path for names, authors, descriptions, config field descriptions, and resource menu labels. This makes plugin store listings and management UI menus hard to localize without custom frontend-side mapping.
Changes
localequery parameterX-LocaleheaderAccept-LanguageX-Locale.Compatibility
All locale fields are optional and preserve existing behavior when omitted. Existing plugin metadata and resource routes continue to work without changes.
Resource route dispatch remains path-based. Resource menu paths may include query parameters for launch URLs, but handler dispatch uses the path portion and forwards query values in the request object.
Testing
go test ./internal/pluginhost ./internal/plugini18n ./internal/pluginstore ./internal/api/handlers/management ./sdk/pluginapigo test ./...go build -o /private/tmp/cpa-cli-proxy-api-test-output ./cmd/server