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 th: Record<string, string> = {
pluginDocsPanelDesc: 'เอกสารส่วนกลางในแถบด้านข้าง DSH: อ่านบันทึก Markdown ของคุณเองจากพื้นที่ทำงานใดๆ — รายการไฟล์, เค้าโครง, เปิดใน Chrome / VS Code และปุ่มคัดลอก; ไดเรกทอรีเอกสารสามารถกำหนดค่าได้ (ค่าเริ่มต้น ~/.dsh/docs)',
pluginEgoBrowserDesc: 'เบราว์เซอร์เอเจนต์สำหรับ DeepSeek Harness: เครื่องมือ ego_* 32 ตัวขับเคลื่อน Chromium จริง แท็บ «ego browser» เนทีฟในแถบด้านข้างแสดงทุกหน้าที่เอเจนต์เยี่ยมชมแบบสด — คลิก ลาก และพิมพ์เพื่อเข้าไปควบคุมแทนได้ ลงทะเบียนแท็บอัตโนมัติเมื่อมี better-sidebar มิฉะนั้นจะใช้บับเบิลลอย',
pluginBilingualReaderDesc: 'อ่าน PDF ในแถบด้านข้าง DSH: แสดง 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 Remote ของ 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 จอง 32px ให้แถบหัวเรื่องเมื่อไม่มี WCO',
}