diff --git a/apps/desktop/src/components/config/DriverStoreDialog.vue b/apps/desktop/src/components/config/DriverStoreDialog.vue index 1c1fbc060..eb994ba5f 100644 --- a/apps/desktop/src/components/config/DriverStoreDialog.vue +++ b/apps/desktop/src/components/config/DriverStoreDialog.vue @@ -66,8 +66,8 @@ const installedJres = computed(() => { const progressText = computed(() => { const p = progress.value; if (!p) return ""; - if (p.step === "jre-extract") return "解压 JRE..."; - const label = p.step === "jre" ? "下载 JRE" : "下载驱动"; + if (p.step === "jre-extract") return t("driverStore.progressJreExtract"); + const label = p.step === "jre" ? t("driverStore.progressDownloadJre") : t("driverStore.progressDownloadDriver"); if (!p.total) return `${label}...`; const pct = Math.round(((p.downloaded ?? 0) / p.total) * 100); const dl = formatSize(p.downloaded ?? 0); @@ -86,11 +86,11 @@ const usageSummary = computed(() => { const usage = driverStoreUsage.value; if (!usage) return []; return [ - { key: "total", label: "总计", bytes: usage.total_bytes }, - { key: "jre", label: "托管 JRE", bytes: usage.jre_bytes }, - { key: "agent", label: "内置驱动 Agent", bytes: usage.agent_driver_bytes }, - { key: "jdbc-plugin", label: "JDBC 插件", bytes: usage.jdbc_plugin_bytes }, - { key: "jdbc-driver", label: "JDBC 驱动 JAR", bytes: usage.jdbc_driver_bytes }, + { key: "total", label: t("driverStore.usageTotalLabel"), bytes: usage.total_bytes }, + { key: "jre", label: t("driverStore.usageManagedJre"), bytes: usage.jre_bytes }, + { key: "agent", label: t("driverStore.usageAgentDrivers"), bytes: usage.agent_driver_bytes }, + { key: "jdbc-plugin", label: t("driverStore.usageJdbcPlugin"), bytes: usage.jdbc_plugin_bytes }, + { key: "jdbc-driver", label: t("driverStore.usageJdbcDriverJars"), bytes: usage.jdbc_driver_bytes }, ]; }); const jreUsageByKey = computed(() => { @@ -178,9 +178,9 @@ async function saveJavaRuntimeConfig() { }); javaRuntimeConfig.value = config; customJavaPath.value = config.custom_java_path ?? ""; - toast("Java 运行时设置已保存"); + toast(t("driverStore.javaRuntimeSaved")); } catch (e: any) { - toast(`Java 运行时设置失败: ${e}`); + toast(t("driverStore.javaRuntimeSaveFailed", { error: e })); } finally { savingJavaRuntime.value = false; } @@ -190,7 +190,7 @@ async function chooseCustomJavaPath() { if (isWeb) return; const { open } = await import("@tauri-apps/plugin-dialog"); const selected = await open({ - title: "选择 Java 可执行文件", + title: t("driverStore.chooseJavaExecutable"), multiple: false, }); if (typeof selected === "string") { @@ -214,9 +214,9 @@ async function runDriverInstall(dbType: string) { try { await api.installAgent(dbType); await refreshAgents(); - toast(`${label} 驱动安装成功`); + toast(t("driverStore.driverInstallSuccess", { label })); } catch (e: any) { - toast(`${label} 驱动安装失败: ${e}`); + toast(t("driverStore.driverInstallFailed", { label, error: e })); } finally { installing.value = null; progress.value = null; @@ -241,9 +241,9 @@ async function upgradeAll() { try { const count = await api.upgradeAllAgents(); await refreshAgents(); - toast(`${count} 个驱动升级完成`); + toast(t("driverStore.upgradeAllSuccess", { count })); } catch (e: any) { - toast(`批量升级失败: ${e}`); + toast(t("driverStore.upgradeAllFailed", { error: e })); } finally { upgradingAll.value = false; upgradingCurrent.value = ""; @@ -258,9 +258,9 @@ async function uninstallDriver(dbType: string) { try { await api.uninstallAgent(dbType); await refreshAgents(); - toast(`${label} 驱动已卸载`); + toast(t("driverStore.driverUninstallSuccess", { label })); } catch (e: any) { - toast(`${label} 驱动卸载失败: ${e}`); + toast(t("driverStore.driverUninstallFailed", { label, error: e })); } } @@ -312,7 +312,7 @@ async function importOfflineZip() { } else { const { open } = await import("@tauri-apps/plugin-dialog"); const path = await open({ - title: "选择离线驱动包", + title: t("driverStore.chooseOfflineDriverPackage"), multiple: false, filters: [{ name: "ZIP", extensions: ["zip"] }], }); @@ -324,9 +324,9 @@ async function importOfflineZip() { try { const count = await api.importAgentsFromZip(selected); await refreshAgents(); - toast(`离线导入完成,已安装 ${count} 个驱动`); + toast(t("driverStore.offlineImportSuccess", { count })); } catch (e: any) { - toast(`离线导入失败: ${e}`); + toast(t("driverStore.offlineImportFailed", { error: e })); } finally { importingZip.value = false; progress.value = null; @@ -341,15 +341,15 @@ async function importDriverJar(dbType: string) { try { await api.importAgentJar(dbType, file); await refreshAgents(); - toast(`${label} 驱动导入成功`); + toast(t("driverStore.driverImportSuccess", { label })); } catch (e: any) { - toast(`${label} 驱动导入失败: ${e}`); + toast(t("driverStore.driverImportFailed", { label, error: e })); } return; } const { open } = await import("@tauri-apps/plugin-dialog"); const selected = await open({ - title: "选择驱动 JAR 文件", + title: t("driverStore.chooseDriverJar"), multiple: false, filters: [{ name: "JAR", extensions: ["jar"] }], }); @@ -357,9 +357,9 @@ async function importDriverJar(dbType: string) { try { await api.importAgentJar(dbType, selected); await refreshAgents(); - toast(`${label} 驱动导入成功`); + toast(t("driverStore.driverImportSuccess", { label })); } catch (e: any) { - toast(`${label} 驱动导入失败: ${e}`); + toast(t("driverStore.driverImportFailed", { label, error: e })); } } @@ -369,9 +369,9 @@ async function reinstallJre(jreKey: string) { try { await api.reinstallJre(jreKey); await refreshAgents(); - toast(`JRE ${jreKey} 重新安装成功`); + toast(t("driverStore.jreReinstallSuccess", { jre: jreKey })); } catch (e: any) { - toast(`JRE ${jreKey} 重新安装失败: ${e}`); + toast(t("driverStore.jreReinstallFailed", { jre: jreKey, error: e })); } finally { reinstallingJre.value = null; progress.value = null; @@ -382,7 +382,7 @@ async function uninstallJre(jreKey: string) { try { await api.uninstallJre(jreKey); await refreshAgents(); - toast(`JRE ${jreKey} 已卸载`); + toast(t("driverStore.jreUninstallSuccess", { jre: jreKey })); } catch (e: any) { toast(String(e)); } @@ -466,7 +466,7 @@ async function installJdbcPluginLocal() { } else { const { open } = await import("@tauri-apps/plugin-dialog"); const result = await open({ - title: "选择 JDBC 插件 zip 文件", + title: t("driverStore.chooseJdbcPluginZip"), multiple: false, filters: [{ name: "ZIP", extensions: ["zip"] }], }); @@ -597,9 +597,13 @@ onUnmounted(() => {
-
空间占用明细
+
{{ t("driverStore.usageTitle") }}
- {{ usageSummary.length ? `总计 ${formatBytes(usageSummary[0].bytes)}` : "统计中..." }} + {{ + usageSummary.length + ? t("driverStore.usageTotal", { size: formatBytes(usageSummary[0].bytes) }) + : t("driverStore.calculating") + }}
@@ -617,11 +621,11 @@ onUnmounted(() => {
- 内置驱动 + {{ t("driverStore.agentDrivers") }} - JDBC 驱动 + {{ t("driverStore.jdbcDrivers") }} @@ -634,7 +638,7 @@ onUnmounted(() => { @click="importOfflineZip" > - {{ importingZip ? "导入中..." : "导入离线包" }} + {{ importingZip ? t("driverStore.importing") : t("driverStore.importOfflinePackage") }}
@@ -655,15 +659,15 @@ onUnmounted(() => {
- +
@@ -672,23 +676,23 @@ onUnmounted(() => { :disabled="savingJavaRuntime || (javaRuntimeConfig.mode === 'custom' && !customJavaPath.trim())" @click="saveJavaRuntimeConfig" > - {{ savingJavaRuntime ? "保存中..." : "保存" }} + {{ savingJavaRuntime ? t("driverStore.saving") : t("settings.save") }}

- 使用当前环境 PATH 中的 java。 + {{ t("driverStore.systemJavaHint") }}

@@ -696,7 +700,7 @@ onUnmounted(() => {
-
JRE {{ jre.key }} 运行时
+
{{ t("driverStore.jreRuntimeTitle", { jre: jre.key }) }}
{ {{ jreUsageLabel(jre.key) }} - 未安装 + {{ t("driverStore.notInstalled") }}
-
JRE 运行时
-

首次安装驱动时自动下载

+
{{ t("driverStore.jreRuntime") }}
+

{{ t("driverStore.jreRuntimeAutoDownloadHint") }}

-
加载中...
+
+ {{ t("common.loading") }} +
- {{ updatableCount }} 个驱动可更新 + {{ + t("driverStore.driversUpdatable", { count: updatableCount }) + }}
{ @click="removeQueuedDriverInstall(driver.db_type)" > - 排队中 + {{ t("driverStore.queued") }}
@@ -967,7 +979,7 @@ onUnmounted(() => { @click="installJdbcPluginLocal" > - 本地安装 + {{ t("driverStore.localInstall") }}
diff --git a/apps/desktop/src/components/connection/ConnectionDialog.vue b/apps/desktop/src/components/connection/ConnectionDialog.vue index 582030b76..333e7d7a2 100644 --- a/apps/desktop/src/components/connection/ConnectionDialog.vue +++ b/apps/desktop/src/components/connection/ConnectionDialog.vue @@ -1901,7 +1901,7 @@ function openExternalUrl(url: string) {
- +
@@ -1916,7 +1916,7 @@ function openExternalUrl(url: string) { :aria-pressed="form.oracle_connection_type !== 'sid'" @click="form.oracle_connection_type = 'service_name'" > - 服务名 + {{ t("connection.serviceNameOnly") }}
- +