From e0fefe75fab810c26ebde4c25bbf68d010c8e468 Mon Sep 17 00:00:00 2001 From: Quickbeard Date: Tue, 25 Aug 2026 10:10:28 +0700 Subject: [PATCH 1/2] feat(app): translate the desktop menu MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The app menu was the last English-only surface in a translated UI: its labels were literals in DESKTOP_MENU, which is shared by the macOS native menu bar (built in the desktop main process) and the Windows/Linux titlebar menu (built in the renderer). Labels are now dictionary keys, typed against the English dict so a missing key fails typecheck. windows-app-menu.tsx resolves them through useLanguage().t. The macOS bar resolves them in main/menu-i18n.ts, which dynamic-imports the selected locale's dict and reads the locale from the same codev.global.dat record the renderer's i18n reads — so Windows and Linux, which never build a native menu, load no dictionary at all. createMenu is async as a result, and ipc.ts's store-set handler calls refreshMenuLanguage() so a language change rebuilds the bar rather than leaving it a launch behind. 45 menu.* keys added to en/es/vi, following .codev/glossary/vi.md — the Vietnamese keeps session, terminal, webview and developer tools in English. A parity test asserts every labelKey resolves in all three locales, and pickMenuLocale is unit-tested against the record shape the app actually persists. Co-Authored-By: Claude Opus 5 (1M context) --- CHANGELOG.md | 9 ++ DIVERGENCES.md | 7 +- packages/app/package.json | 1 + .../app/src/components/windows-app-menu.tsx | 6 +- packages/app/src/desktop-menu.test.ts | 24 +++- packages/app/src/desktop-menu.ts | 130 +++++++++++------- packages/app/src/i18n/en.ts | 48 +++++++ packages/app/src/i18n/es.ts | 48 +++++++ packages/app/src/i18n/vi.ts | 48 +++++++ packages/desktop/src/main/index.ts | 2 +- packages/desktop/src/main/ipc.ts | 4 + packages/desktop/src/main/menu-i18n.ts | 26 ++++ packages/desktop/src/main/menu-locale.test.ts | 28 ++++ packages/desktop/src/main/menu-locale.ts | 23 ++++ packages/desktop/src/main/menu.ts | 32 ++++- 15 files changed, 369 insertions(+), 67 deletions(-) create mode 100644 packages/desktop/src/main/menu-i18n.ts create mode 100644 packages/desktop/src/main/menu-locale.test.ts create mode 100644 packages/desktop/src/main/menu-locale.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 01aacef046..dd35aefe99 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,15 @@ file is the human-readable summary of what changed and why. session, prompt, token, commit, branch, and agent stay in English (the glossary lives in `.codev/glossary/vi.md`). ([#307](https://github.com/quickbeard/codev-code/pull/307)) +- **The app menu is translated too** — File, Edit, View, Go, Window and Help + and everything inside them stayed English no matter which language the rest + of the app was in: the menu was built from fixed English text rather than + from the dictionaries. It now follows your language like every other + surface, on the macOS menu bar and the Windows/Linux titlebar menu alike, + and switching language updates it without a restart. Developer terms stay in + English where Vietnamese developers expect them — session, terminal, + webview, developer tools. + ([#320](https://github.com/quickbeard/codev-code/pull/320)) ### Privacy diff --git a/DIVERGENCES.md b/DIVERGENCES.md index 8e43663adf..0b04163905 100644 --- a/DIVERGENCES.md +++ b/DIVERGENCES.md @@ -185,7 +185,8 @@ from the squash message first, or use a plain merge. | `packages/app/src/pages/layout.tsx`, `packages/app/src/pages/layout-new.tsx` | Dropped the `` mount and its import from both layouts (added upstream in v1.17.18; since v1.18.3 upstream itself removed the sibling `HelpButton`, so nothing is imported from `help-button` anymore) | `TabsInfoPopup` is a dev-channel-only "Introducing Tabs" promo whose `muted autoplay loop` `