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:
@@ -419,4 +419,24 @@ export const id: Record<string, string> = {
|
||||
pluginDocsPanelDesc: 'Dokumen global di sidebar DSH: baca catatan Markdown Anda sendiri dari ruang kerja apa pun — daftar berkas, kerangka, buka di Chrome / VS Code, dan tombol salin; direktori docs dapat dikonfigurasi (default ~/.dsh/docs)',
|
||||
pluginEgoBrowserDesc: 'Browser agen untuk DeepSeek Harness: 32 alat ego_* menggerakkan Chromium sungguhan; tab «ego browser» native di bilah samping menampilkan langsung setiap halaman yang dikunjungi agen — Anda bisa mengklik, menyeret, dan mengetik untuk mengambil alih. Tab terdaftar otomatis jika better-sidebar terpasang; jika tidak, jatuh ke gelembung mengambang',
|
||||
pluginBilingualReaderDesc: 'Baca PDF di sidebar DSH: tampilan PDF asli, pilih teks untuk diterjemahkan dengan LLM, dengan konteks dan sepenuhnya terisolasi dari percakapan utama',
|
||||
pluginSentinelName: 'dsh-sentinel Sistem bangun',
|
||||
pluginEgoBrowserName: 'ego-browser Peramban agen',
|
||||
pluginBetterOverleafName: 'dsh-better-overleaf Tab Overleaf',
|
||||
pluginDocsPanelName: 'dsh-docs-panel Dokumen global',
|
||||
pluginFlowglassName: 'dsh-flowglass Flowglass',
|
||||
pluginGitForgeName: 'dsh-git-forge Kredensial Git',
|
||||
pluginGitRemotesName: 'dsh-git-remotes Remote Git',
|
||||
pluginGithubWorkbenchName: 'dsh-github-workbench Meja kerja GitHub',
|
||||
pluginSidebarQaName: 'dsh-sidebar-qa Pilih & tanya',
|
||||
pluginSidenoteName: 'dsh-sidenote Obrolan samping',
|
||||
pluginServerDeckName: 'dsh-server-deck Dek server',
|
||||
pluginSuhuangScrollName: 'dsh-suhuang-scroll Suhuang Scroll',
|
||||
pluginSshTunnelName: 'dsh-ssh-tunnel Terowongan SSH',
|
||||
pluginTurnReviewName: 'dsh-turn-review Tinjauan giliran',
|
||||
pluginBilingualReaderName: 'dsh-bilingual-reader Pembaca dwibahasa',
|
||||
pluginOfficeName: 'Pratinjau Office',
|
||||
pluginMdExportName: 'Ekspor Markdown',
|
||||
pluginCodeNavName: 'Navigator pratinjau kode',
|
||||
pluginVideoPreviewName: 'Pratinjau video',
|
||||
presetDshDesktopDesc: 'Mode Electron lanjutan (tanpa bingkai): macOS mencadangkan 20px di atas; Windows mencadangkan 32px untuk bilah judul saat WCO tidak tersedia',
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user