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 hi: Record<string, string> = {
pluginDocsPanelDesc: 'DSH साइडबार में ग्लोबल डॉक्स: किसी भी वर्कस्पेस से अपने Markdown नोट्स पढ़ें — फ़ाइल सूची, रूपरेखा, Chrome / VS Code में खोलें, और कॉपी बटन; docs डायरेक्टरी कॉन्फ़िगर करने योग्य (डिफ़ॉल्ट ~/.dsh/docs)',
pluginEgoBrowserDesc: 'DeepSeek Harness के लिए एजेंट ब्राउज़र: 32 ego_* टूल असली Chromium चलाते हैं; साइडबार में नेटिव «ego browser» टैब एजेंट के हर विज़िट किए गए पेज को लाइव दिखाता है — आप क्लिक, ड्रैग और टाइप करके नियंत्रण ले सकते हैं। better-sidebar मौजूद होने पर टैब स्वतः रजिस्टर होता है, अन्यथा फ्लोटिंग बबल के रूप में दिखता है',
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 रखता है',
}