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:
1 parent
9e1a034527
commit
fa301da29e
29 files changed
+510
-57
No files matched your search
@@ -436,4 +436,24 @@ export const zhTW: Record<string, string> = {
|
||||
pluginDocsPanelDesc: 'DSH 側邊欄裡的「全域文件」:全域 Markdown 筆記,任何工作區隨時可讀——列表點選閱讀、懸浮大綱跳轉、Chrome / VS Code 外部開啟、程式碼複製,目錄可設定(預設 ~/.dsh/docs)',
|
||||
pluginEgoBrowserDesc: '將 CitroLabs/ego-lite 接進 DeepSeek Harness 的 agent 瀏覽器:32 個 ego_* 工具驅動真實 Chromium,側邊欄原生「ego 瀏覽器」Tab 實時觀察 agent 逛的每個頁面,可直接點擊/拖拽/輸入接管;裝 better-sidebar 時自動註冊 Tab,沒裝則退回浮動浮窗',
|
||||
pluginBilingualReaderDesc: '在 DSH 側邊欄讀論文 PDF:原生 PDF 顯示,選取一段文字即用大模型劃詞翻譯,結合上下文、完全隔離主對話,只作閱讀輔助',
|
||||
pluginSentinelName: 'dsh-sentinel 喚醒系統',
|
||||
pluginEgoBrowserName: 'ego-browser Agent 瀏覽器',
|
||||
pluginBetterOverleafName: 'dsh-better-overleaf Overleaf 標籤',
|
||||
pluginDocsPanelName: 'dsh-docs-panel 全域文件',
|
||||
pluginFlowglassName: 'dsh-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 蘇黃共閱',
|
||||
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 標題列讓位',
|
||||
}
|
||||
Reference in new issue
Block a user