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
2026-09-03 19:59:00 +08:00
parent 9e1a034527
commit fa301da29e
29 changed files with 510 additions and 57 deletions
+20
View File
@@ -421,4 +421,24 @@ export const ja: Record<string, string> = {
pluginDocsPanelDesc: 'DSH サイドバー内の「グローバルドキュメント」:任意のワークスペースから読めるグローバル Markdown ノート。リストで選んで閲覧、ホバーでアウトラインジャンプ、Chrome / VS Code で外部オープン、コードコピー。ディレクトリは設定可(デフォルト ~/.dsh/docs)',
pluginEgoBrowserDesc: 'DeepSeek Harness 用エージェントブラウザ:32 個の ego_* ツールが本物の Chromium を操作し、サイドバーのネイティブ「ego ブラウザ」Tab がエージェントの訪れる全ページをライブ表示。クリック・ドラッグ・入力で操作を引き継げます。better-sidebar があれば Tab を自動登録、なければフローティングバブルにフォールバック',
pluginBilingualReaderDesc: 'DSH サイドバーで論文 PDF を読む:ネイティブ PDF 表示、テキストを選択して LLM で翻訳。コンテキストを使い、メイン会話から完全に分離',
pluginSentinelName: 'dsh-sentinel ウェイクアップシステム',
pluginEgoBrowserName: 'ego-browser エージェントブラウザー',
pluginBetterOverleafName: 'dsh-better-overleaf Overleaf タブ',
pluginDocsPanelName: 'dsh-docs-panel グローバルドキュメント',
pluginFlowglassName: 'dsh-flowglass Flowglass',
pluginGitForgeName: 'dsh-git-forge Git 認証情報',
pluginGitRemotesName: 'dsh-git-remotes Git リモート',
pluginGithubWorkbenchName: 'dsh-github-workbench GitHub ワークベンチ',
pluginSidebarQaName: 'dsh-sidebar-qa 選択して質問',
pluginSidenoteName: 'dsh-sidenote サイドチャット',
pluginServerDeckName: 'dsh-server-deck サーバーデッキ',
pluginSuhuangScrollName: 'dsh-suhuang-scroll Suhuang Scroll',
pluginSshTunnelName: 'dsh-ssh-tunnel SSH トンネル',
pluginTurnReviewName: 'dsh-turn-review ターンレビュー',
pluginBilingualReaderName: 'dsh-bilingual-reader バイリンガルリーダー',
pluginOfficeName: 'Office プレビュー',
pluginMdExportName: 'Markdown エクスポート',
pluginCodeNavName: 'コードプレビューナビゲーター',
pluginVideoPreviewName: '動画プレビュー',
presetDshDesktopDesc: 'Electron 高度モード(枠なし):macOS は上部 20px、Windows は WCO 未提供時に 32px のタイトルバー分を確保',
}