feat: multi-language interface (zh-CN/zh-TW/en/ja), multilingual offline changelog, settings robustness
i18n - shared/i18n: dependency-free t() with flat per-namespace dictionaries (common/settings/workspace/terminal/ssh/panels/main), zh-CN fallback - language picker in Settings -> System; antd ConfigProvider locale follows it - main process tracks the language too: tray menu, close prompt, ssh/sftp/ zmodem errors and the log TUI marker are translated; tray rebuilds on change changelog - CHANGELOG.md (zh-CN canonical) + .zh-TW/.en/.ja, bundled via ?raw and read per interface language with per-version fallback to zh-CN (no network) - sync-changelog.cjs merges RELEASE_NOTES[.<lang>].md per release; release.cjs refuses to publish without a zh-CN entry for the version settings robustness - closeAction 'ask' survives the sanitizer (was silently coerced to 'tray', which made the 'ask every time' option dead) - highlight rules are repaired instead of dropped: string priority, 0/1 enabled, missing fg colour; unknown fields preserved - load-time warnings are written to settings-warnings.log (deduped, capped) terminal/UI - configurable terminal toolbar: open working directory (default on), session log recording (off), open logs folder (off) - global shortcut field records key combos (modifier or F-key required) - input suggestions + command history default to off, with a one-time reset migration for existing installs - settings dialog scrolling fixed (antd v6 renamed the tabs container), theme gallery nested scrollbar removed, joined segmented pickers with readable selected-state text tests: settings-store.mjs (15 checks) added; commands-store.mjs updated for the new off-by-default history setting
This commit is contained in:
1 parent
34094d607b
commit
4c6a29ef28
82 files changed
+3342
-608
No files matched your search
+4
-3
@@ -14,6 +14,7 @@
|
||||
*/
|
||||
|
||||
import { Ipc } from '../shared/ipc'
|
||||
import { t } from '../shared/i18n'
|
||||
import type { Client } from 'ssh2'
|
||||
import type { SysinfoMeta, SysinfoSample } from '../shared/sysinfo'
|
||||
|
||||
@@ -116,7 +117,7 @@ function pollOnce(id: string, state: PollState): void {
|
||||
if (state.stopped) return
|
||||
const client = clientProvider?.(id)
|
||||
if (!client) {
|
||||
handleError(id, state, 'SSH 会话不存在或已断开')
|
||||
handleError(id, state, t('main.sysinfo.sessionGone'))
|
||||
return
|
||||
}
|
||||
|
||||
@@ -124,7 +125,7 @@ function pollOnce(id: string, state: PollState): void {
|
||||
client.exec(COLLECT_CMD, (err: Error | undefined, stream) => {
|
||||
if (state.stopped) return
|
||||
if (err || !stream) {
|
||||
handleError(id, state, err?.message || 'SSH exec 失败')
|
||||
handleError(id, state, err?.message || t('main.sysinfo.execFailed'))
|
||||
return
|
||||
}
|
||||
let out = ''
|
||||
@@ -220,7 +221,7 @@ function handleOutput(id: string, state: PollState, out: string): void {
|
||||
broadcastMeta(id, { hostname: parsed.hostname, os: parsed.osInfo })
|
||||
}
|
||||
} catch (err) {
|
||||
handleError(id, state, `解析失败: ${(err as Error).message}`)
|
||||
handleError(id, state, t('main.sysinfo.parseFailed', { message: (err as Error).message }))
|
||||
return
|
||||
}
|
||||
armNext(id, state)
|
||||
|
||||
Reference in new issue
Block a user