From 23f96c6efa36896399542138b83035fdd7e63751 Mon Sep 17 00:00:00 2001 From: DS <78942835+Tarquinen@users.noreply.github.com> Date: Fri, 6 Nov 2026 20:39:26 -0500 Subject: [PATCH] fix(desktop): translate cut, copy, paste and select all in the right-click menu (#62252) --- .../desktop/src/main/lifecycle/environment.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/packages/desktop/src/main/lifecycle/environment.ts b/packages/desktop/src/main/lifecycle/environment.ts index 67d11df749c..2f6e54eff20 100644 --- a/packages/desktop/src/main/lifecycle/environment.ts +++ b/packages/desktop/src/main/lifecycle/environment.ts @@ -7,6 +7,7 @@ import { getUserShell, loadShellEnv } from "../service/shell-env" import { registerRendererProtocol, setDockIcon, setProtocolReporter } from "../windows" import { scoped } from "../native/logging" import { applySpellcheck, spellcheckMenuItems } from "../native/spellcheck" +import { nativeT } from "../native/translations" // electron-context-menu attaches to every existing and future window, so it can load once the first // window is up instead of holding up startup with its dependency tree. @@ -16,6 +17,21 @@ export const installContextMenu = Effect.gen(function* () { showSaveImageAs: true, showLookUpSelection: false, showSearchWithGoogle: false, + // Getters, because electron-context-menu reads the labels each time the menu opens. + labels: { + get cut() { + return nativeT("desktop.menu.cut") + }, + get copy() { + return nativeT("desktop.menu.copy") + }, + get paste() { + return nativeT("desktop.menu.paste") + }, + get selectAll() { + return nativeT("desktop.menu.selectAll") + }, + }, append: (_actions, params) => (params.isEditable ? spellcheckMenuItems() : []), }) })