feat(i18n): localize plugin catalog names and shell preset desc

Catalog entry names (15 tab + 4 viewer) and the dsh-desktop shell preset
desc were raw hardcoded zh strings rendered straight into the add-plugin
modals and the title-bar scheme dropdown. Mirror the existing desc
pattern exactly: PluginEntry.name / ShellPreset.desc widen to the
i18n-friendly string-or-() =>-string union, the catalogs carry lazy
t('pluginXxxName') / t('presetDshDesktopDesc') lookups, and the
add-plugin modal (render, search filter, aria-labels) plus the scheme
SelectMenu resolve them like every other copy. The plain-string arm of
the union stays as the raw-name fallback, and t() itself never yields
empty text (missing keys render the key), so a dict gap can never blank
a name.

20 new dictionary keys added to zh/en (locales.ts), ja (locales-ja.ts),
and all 18 third-language dictionaries — tests/locales.spec.ts enforces
key-set equality against zh for every shipped dict (precedent: 9cc642b),
so the 'leave other locales-* untouched' shortcut would fail the hard
parity gate; real translations are provided instead.

Spec follow-ups (behavior change: names/descs now render through t()):
- plugin-list.spec.ts: name non-empty assertion resolves the union.
- add-plugin-modal.spec.tsx: sentinel/office name assertions resolve
  from the catalog (en locale in tests) instead of pinning zh literals.
- shell-presets.spec.ts: desc non-empty assertion resolves the union.
This commit is contained in:
Menghuan1918 committed 2026-09-03 19:59:00 +08:00
1 parent 9e1a034527
commit fa301da29e
29 files changed
+510 -57

No files matched your search

+20
View File
@@ -414,4 +414,24 @@ export const fr: Record<string, string> = {
pluginDocsPanelDesc: '« Documentation globale » dans la barre latérale DSH : notes Markdown globales, lisibles depuis n’importe quel espace de travail — sélection dans la liste, saut via le plan flottant, ouverture externe Chrome / VS Code, copie de code, répertoire configurable (défaut ~/.dsh/docs)',
pluginEgoBrowserDesc: 'Le navigateur d’agent pour DeepSeek Harness : 32 outils ego_* pilotent un vrai Chromium ; un onglet natif « ego browser » dans la barre latérale montre en direct chaque page visitée par l’agent — cliquez, glissez et tapez pour reprendre la main. Enregistre l’onglet automatiquement si better-sidebar est présent, sinon une bulle flottante',
pluginBilingualReaderDesc: 'Lire des PDF dans la barre latérale DSH : affichage PDF natif, sélectionnez du texte pour le traduire avec le LLM, avec contexte et totalement isolé de la conversation principale',
pluginSentinelName: 'dsh-sentinel Système de réveil',
pluginEgoBrowserName: 'ego-browser Navigateur d’agents',
pluginBetterOverleafName: 'dsh-better-overleaf Onglet Overleaf',
pluginDocsPanelName: 'dsh-docs-panel Docs globales',
pluginFlowglassName: 'dsh-flowglass Flowglass',
pluginGitForgeName: 'dsh-git-forge Identifiants Git',
pluginGitRemotesName: 'dsh-git-remotes Dépôts distants Git',
pluginGithubWorkbenchName: 'dsh-github-workbench Atelier GitHub',
pluginSidebarQaName: 'dsh-sidebar-qa Sélectionner & demander',
pluginSidenoteName: 'dsh-sidenote Chat latéral',
pluginServerDeckName: 'dsh-server-deck Tableau de bord serveurs',
pluginSuhuangScrollName: 'dsh-suhuang-scroll Suhuang Scroll',
pluginSshTunnelName: 'dsh-ssh-tunnel Tunnel SSH',
pluginTurnReviewName: 'dsh-turn-review Revue du tour',
pluginBilingualReaderName: 'dsh-bilingual-reader Lecteur bilingue',
pluginOfficeName: 'Aperçu Office',
pluginMdExportName: 'Exportation Markdown',
pluginCodeNavName: 'Navigateur d’aperçu de code',
pluginVideoPreviewName: 'Aperçu vidéo',
presetDshDesktopDesc: 'Mode avancé Electron (sans bordure) : macOS réserve 20px en haut ; Windows réserve 32px pour la barre de titre sans WCO',
}