From df95288aab9399fc0504465c7920f4e85097a715 Mon Sep 17 00:00:00 2001 From: Melody Ruch <396921921@qq.com> Date: Fri, 14 Aug 2026 14:47:08 +0800 Subject: [PATCH] fix(editor): display configured execute shortcut --- .../editor/EditorSettingsDialog.vue | 12 +++-- .../src/components/layout/EditorToolbar.vue | 7 ++- .../__tests__/executeShortcutHint.spec.ts | 50 +++++++++++++++++++ apps/desktop/src/i18n/locales/en.ts | 4 +- apps/desktop/src/i18n/locales/es.ts | 4 +- apps/desktop/src/i18n/locales/it.ts | 4 +- apps/desktop/src/i18n/locales/ja.ts | 4 +- apps/desktop/src/i18n/locales/ko.ts | 4 +- apps/desktop/src/i18n/locales/pt-BR.ts | 4 +- apps/desktop/src/i18n/locales/zh-CN.ts | 4 +- apps/desktop/src/i18n/locales/zh-TW.ts | 4 +- 11 files changed, 80 insertions(+), 21 deletions(-) create mode 100644 apps/desktop/src/i18n/__tests__/executeShortcutHint.spec.ts diff --git a/apps/desktop/src/components/editor/EditorSettingsDialog.vue b/apps/desktop/src/components/editor/EditorSettingsDialog.vue index 254d487578..9a58d8953e 100644 --- a/apps/desktop/src/components/editor/EditorSettingsDialog.vue +++ b/apps/desktop/src/components/editor/EditorSettingsDialog.vue @@ -275,6 +275,11 @@ const editCustomThemes = ref([...settingsStore.editorSettings.cus const editActiveCustomThemeId = ref(settingsStore.editorSettings.activeCustomThemeId); const showThemeCustomizer = ref(false); const editExecuteMode = ref(settingsStore.editorSettings.executeMode); +const editShortcuts = ref(normalizeShortcutSettings(settingsStore.editorSettings.shortcuts)); +function translateWithExecuteShortcut(key: string): string { + return t(key, { shortcut: formatShortcutDisplay(editShortcuts.value.executeSql) }); +} +const executeModeLabel = computed(() => translateWithExecuteShortcut("settings.executeMode")); const editExecuteAllOnBlankLine = ref(settingsStore.editorSettings.executeAllOnBlankLine); const editShowExecutionTargetPicker = ref(settingsStore.editorSettings.showExecutionTargetPicker); const editShowStatementRunButtons = ref(settingsStore.editorSettings.showStatementRunButtons); @@ -379,7 +384,6 @@ function setSqlVariableSyntaxToggle(key: keyof SqlVariableSyntaxToggles, value: const tableColumnTemplateSectionRef = ref(null); const draggedTableColumnTemplateRowId = ref(null); let tableColumnTemplatePointerDragCleanup: (() => void) | null = null; -const editShortcuts = ref(normalizeShortcutSettings(settingsStore.editorSettings.shortcuts)); const editSqlFormatter = ref(normalizeSqlFormatterSettings(settingsStore.editorSettings.sqlFormatter)); const sqlFormatterConfigValid = ref(true); const editingShortcutId = ref(null); @@ -1474,7 +1478,7 @@ const settingsSearchEntries = computed(() => isWeb, visibleCategories: new Set(settingsCategoryNav.value.map((category) => category.value)), }, - t, + translateWithExecuteShortcut, settingsSearchCategoryLabels.value, ), ); @@ -3681,10 +3685,10 @@ onUnmounted(() => {
- +