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
@@ -421,4 +421,24 @@ export const vi: Record<string, string> = {
pluginDocsPanelDesc: '«Tài liệu toàn cục» trong thanh bên DSH: ghi chú Markdown toàn cục, đọc từ bất kỳ workspace nào — danh sách chọn để đọc, outline hover để nhảy, mở ngoài trong Chrome / VS Code, sao chép code, thư mục cấu hình được (mặc định ~/.dsh/docs)',
pluginEgoBrowserDesc: 'Trình duyệt agent cho DeepSeek Harness: 32 công cụ ego_* điều khiển Chromium thật; tab «ego browser» gốc trong thanh bên hiển thị trực tiếp mọi trang agent truy cập — bạn có thể bấm, kéo và gõ để tiếp quản. Tự động đăng ký tab khi có better-sidebar, nếu không thì rơi về bong bóng nổi',
pluginBilingualReaderDesc: 'Đọc PDF trong thanh bên DSH: hiển thị PDF gốc, chọn văn bản để dịch bằng LLM, dùng ngữ cảnh và hoàn toàn tách biệt khỏi cuộc trò chuyện chính',
pluginSentinelName: 'dsh-sentinel Hệ thống đánh thức',
pluginEgoBrowserName: 'ego-browser Trình duyệt agent',
pluginBetterOverleafName: 'dsh-better-overleaf Tab Overleaf',
pluginDocsPanelName: 'dsh-docs-panel Tài liệu toàn cục',
pluginFlowglassName: 'dsh-flowglass Flowglass',
pluginGitForgeName: 'dsh-git-forge Thông tin đăng nhập Git',
pluginGitRemotesName: 'dsh-git-remotes Remote Git',
pluginGithubWorkbenchName: 'dsh-github-workbench Bàn làm việc GitHub',
pluginSidebarQaName: 'dsh-sidebar-qa Chọn & hỏi',
pluginSidenoteName: 'dsh-sidenote Trò chuyện bên',
pluginServerDeckName: 'dsh-server-deck Bảng máy chủ',
pluginSuhuangScrollName: 'dsh-suhuang-scroll Suhuang Scroll',
pluginSshTunnelName: 'dsh-ssh-tunnel Đường hầm SSH',
pluginTurnReviewName: 'dsh-turn-review Duyệt vòng',
pluginBilingualReaderName: 'dsh-bilingual-reader Trình đọc song ngữ',
pluginOfficeName: 'Xem trước Office',
pluginMdExportName: 'Xuất Markdown',
pluginCodeNavName: 'Trình điều hướng xem trước mã',
pluginVideoPreviewName: 'Xem trước video',
presetDshDesktopDesc: 'Chế độ Electron nâng cao (không viền): macOS dành 20px ở trên cùng; Windows dành 32px cho thanh tiêu đề khi không có WCO',
}