Skip to content

fix: show plugin names and descriptions in the UI language - #1658

Open
ZacharyZcR wants to merge 2 commits into
Termix-SSH:dev-26.10.2from
ZacharyZcR:fix/localize-plugin-names
Open

ZacharyZcR wants to merge 2 commits into
Termix-SSH:dev-26.10.2from
ZacharyZcR:fix/localize-plugin-names

Conversation

@ZacharyZcR

Copy link
Copy Markdown
Member

Summary

Fixes plugin names and descriptions showing in English in non-English UIs.

Every plugin ships a translated display name as plugin.name in its own locale namespace (e.g. host-metrics: Host Metrics / 主机指标), but only the Settings sidebar read it. Everywhere else rendered the raw manifest name / 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: new pluginName(t, plugin) / pluginDescription(t, plugin) next to pluginKey. They read <id>:plugin.name / <id>:plugin.description with the manifest value as defaultValue, 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.description isn't shipped by any plugin yet; core now reads it so plugins can add it.
  • Plugins manager: usePluginsManager localizes the merged rows once, so list, grid, table, detail, consent dialog, toasts, sorting by name and search all use the displayed name.
  • Onboarding plugin picker: names, descriptions, radio group labels and "kept because" names.
  • Generated host editor tabs now register labelKey: <id>:plugin.name with the manifest name as label; HostEditor / HostManagerTabs treat label as the fallback for labelKey (it was only set by these tabs).
  • Host plugin sections, host feature filter, bulk enable/disable and reset menus, plugin beta list in Updates, interface preset areas, plugin crash/loading notices.
  • The two existing Settings call sites now use the helper.

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 namespace
  • use-plugins-manager.test.tsx: installed plugin rows carry the translated name/description; an uninstalled registry entry keeps its manifest name/description
  • PluginsStep.test.tsx: onboarding picker renders translated names/descriptions and falls back for untranslated plugins
  • host-feature-tabs.test.tsx: generated tab registers docker:plugin.name with the manifest name as fallback
  • New tests failed before the fix
  • npx vitest run src/ui/tests (only cli-bundle.test.tsx fails, 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

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.
@termix-triage-bot

termix-triage-bot Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

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 /termix review to run it again.

This branch has not been deployed

No deployments
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