DeepSeek Harness Tauri 桌面版 | Only 8mb installer, zero environment setup, preset plugins, Windows / macOS / Linux.
refactor(store): read translations from global i18next
hairyfc25e1f5527fa
diff --git a/src/store/modules/harness/store.ts b/src/store/modules/harness/store.tsindex 32fe3378..26c7f4fd 100644--- a/src/store/modules/harness/store.ts+++ b/src/store/modules/harness/store.ts@@ -2,8 +2,8 @@ import type { UnlistenFn } from '@tauri-apps/api/event'import type { InstallerState, InstallProgress, SetupStatus, SidebarBusyAction } from './types'import { invoke } from '@tauri-apps/api/core'import { listen } from '@tauri-apps/api/event'+import i18next from 'i18next'import { defineStore } from 'valtio-define'-import { setting } from '../setting'import { updater } from '../updater'const MAX_RETRIES = 8@@ -153,7 +153,7 @@ export const harness = defineStore({}if (!healthy) {throw new Error(- setting.t('errors.service_start_timeout', { port: new URL(this.serviceUrl).port || '3080' }),+ i18next.t('errors.service_start_timeout', { port: new URL(this.serviceUrl).port || '3080' }),)}this.serviceHealthy = true@@ -187,7 +187,7 @@ export const harness = defineStore({// 仅首次使用需要检测环境/安装依赖;之后直接进入页面if (!config.installed) {this.status = 'installing'- this.installer = { ...initialInstaller, title: setting.t('status.installing') }+ this.installer = { ...initialInstaller, title: i18next.t('status.installing') }await invoke('install_dependencies')}@@ -261,7 +261,7 @@ export const harness = defineStore({}this.serviceRunning = falsethis.status = 'error'- this.errorMsg = setting.t('ui.stopped')+ this.errorMsg = i18next.t('ui.stopped')},/** 服务未运行时点击"重试":重新拉起服务并等待健康检查 */diff --git a/src/store/modules/setting/index.ts b/src/store/modules/setting/index.tsindex c73e18e3..5bbb734f 100644--- a/src/store/modules/setting/index.ts+++ b/src/store/modules/setting/index.ts@@ -3,7 +3,7 @@ import { persist } from 'valtio-define/plugins'/*** 设置模块:语言偏好(i18n 由 src/i18n 统一管理,组件直接用 react-i18next 的 useTranslation)- * + 侧边栏开关等纯 UI 状态。store 内部动作直接调用 setting.t(...)。+ * + 侧边栏开关等纯 UI 状态。store 内部如需翻译文案,直接使用 i18next.t(...)(见 updater/harness 模块)。*/export const setting = defineStore({state: () => ({