Repository navigation
fix: show plugin names and descriptions in the UI language - #1658
Open
ZacharyZcR wants to merge 2 commits into
Open
ZacharyZcR wants to merge 2 commits into
ZacharyZcR wants to merge 2 commits into
Conversation
Read plugin.name and plugin.description from each plugin's own locale namespace, falling back to the manifest, everywhere core shows a plugin's name: the Plugins manager, onboarding picker, host editor tabs and sections, host filters and bulk actions, beta updates, interface presets and plugin crash/loading notices.
|
AI review | Looks safe to merge Adds helper functions to localize plugin names and descriptions across the UI, updates relevant components and tests, and documents the new locale keys in the plugin guide. No security, rule, or quality issues found. Reviewed 5e7d1c8. AI can be wrong, a maintainer still decides. Comment |
This branch has not been deployed
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.
Summary
Fixes plugin names and descriptions showing in English in non-English UIs.
Every plugin ships a translated display name as
plugin.namein its own locale namespace (e.g. host-metrics:Host Metrics/主机指标), but only the Settings sidebar read it. Everywhere else rendered the raw manifestname/description, so with the UI in Chinese the Plugins manager, the onboarding plugin picker, host editor tabs and the rest still said "Host Metrics".Changes:
src/ui/lib/plugin-i18n.ts: newpluginName(t, plugin)/pluginDescription(t, plugin)next topluginKey. They read<id>:plugin.name/<id>:plugin.descriptionwith the manifest value asdefaultValue, so a plugin whose strings aren't loaded (e.g. a registry entry that isn't installed) shows the manifest text, never a raw key.plugin.descriptionisn't shipped by any plugin yet; core now reads it so plugins can add it.usePluginsManagerlocalizes the merged rows once, so list, grid, table, detail, consent dialog, toasts, sorting by name and search all use the displayed name.labelKey: <id>:plugin.namewith the manifest name aslabel;HostEditor/HostManagerTabstreatlabelas the fallback forlabelKey(it was only set by these tabs).Test plan
src/ui/tests/lib/plugin-i18n.test.ts(new): real i18next in zh-CN returns the translated name/description, falls back to the manifest values (or empty) for a plugin with no loaded namespaceuse-plugins-manager.test.tsx: installed plugin rows carry the translated name/description; an uninstalled registry entry keeps its manifest name/descriptionPluginsStep.test.tsx: onboarding picker renders translated names/descriptions and falls back for untranslated pluginshost-feature-tabs.test.tsx: generated tab registersdocker:plugin.namewith the manifest name as fallbacknpx vitest run src/ui/tests(onlycli-bundle.test.tsxfails, same as without this change in my local worktree setup)tsc -p tsconfig.app.json,tsc -p tsconfig.node.json, eslint, prettier 3.9.6,check-changelog,check-test-locations