From a0dcee51bcf740da0abdb98729e161992c9a1ef0 Mon Sep 17 00:00:00 2001 From: t8y2 <1156263951@qq.com> Date: Mon, 1 Jun 2026 16:05:29 +0800 Subject: [PATCH] feat(i18n): add language selector to settings --- .../editor/EditorSettingsDialog.vue | 25 +++++++++++++++++++ .../src/components/layout/AppToolbar.vue | 13 +++------- apps/desktop/src/i18n/locales/en.ts | 1 + apps/desktop/src/i18n/locales/es.ts | 1 + apps/desktop/src/i18n/locales/zh-CN.ts | 1 + apps/desktop/src/lib/localeOptions.ts | 7 ++++++ 6 files changed, 39 insertions(+), 9 deletions(-) create mode 100644 apps/desktop/src/lib/localeOptions.ts diff --git a/apps/desktop/src/components/editor/EditorSettingsDialog.vue b/apps/desktop/src/components/editor/EditorSettingsDialog.vue index 389ed67d85..4aef9bee1f 100644 --- a/apps/desktop/src/components/editor/EditorSettingsDialog.vue +++ b/apps/desktop/src/components/editor/EditorSettingsDialog.vue @@ -70,6 +70,8 @@ import AiProviderLogo from "@/components/icons/AiProviderLogo.vue"; import AppLogo from "@/components/icons/AppLogo.vue"; import type { AppThemeAppearance } from "@/lib/appTheme"; import { useConnectionStore } from "@/stores/connectionStore"; +import { currentLocale, setLocale, type Locale } from "@/i18n"; +import { LOCALE_OPTIONS } from "@/lib/localeOptions"; const { t } = useI18n(); const settingsStore = useSettingsStore(); @@ -365,6 +367,10 @@ function onThemeChange(v: any) { if (typeof v === "string") editTheme.value = v as typeof DEFAULT_EDITOR_SETTINGS.theme; } +function onLocaleChange(v: any) { + if (typeof v === "string") void setLocale(v as Locale); +} + function onRedisScanPageSizeChange(v: any) { const value = Number(v); if (redisScanPageSizeOptions.includes(value)) editRedisScanPageSize.value = value; @@ -1127,6 +1133,25 @@ watch(
+
+ + +
+ + +