From cc12ea576ff80d59c3bbfb4355be3fb66f4179fe Mon Sep 17 00:00:00 2001 From: con3code Date: Sun, 11 Oct 2026 01:31:26 +0900 Subject: [PATCH] macOS: the menu bar follows the interface language at once MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The system menu bar was built once at launch, so Edit › Interface Language changed the panels but left the menus in the old language until the next launch. It is rebuilt when the language changes. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013phQ3ekq6uGBEWD6FjFYG2 --- apps/designcraft/src/native_menu.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/designcraft/src/native_menu.rs b/apps/designcraft/src/native_menu.rs index 8bf75b159..f235d05fe 100644 --- a/apps/designcraft/src/native_menu.rs +++ b/apps/designcraft/src/native_menu.rs @@ -20,6 +20,8 @@ pub struct NativeMenu { _menu: Menu, items: HashMap, last_refresh: f64, + /// The interface language the titles are in: the menu is rebuilt when it changes. + language: String, } /// Accelerator for "Cmd+Shift+]" (modifier-less shortcuts stay in the app so typing works). @@ -69,7 +71,7 @@ impl NativeMenu { (p.is_null() && accel(sc).is_some()).then(|| id.clone()) }) .collect(); - Self { _menu: menu, items, last_refresh: 0.0 } + Self { _menu: menu, items, last_refresh: 0.0, language: app.ui.language.clone() } } pub fn poll(&mut self, app: &mut DesignApp, ctx: &egui::Context) { @@ -78,6 +80,11 @@ impl NativeMenu { menus::activate_native(app, ctx, &cmd.clone(), ¶ms.clone()); } } + // Edit › Interface Language: the system menu bar follows at once, like the panels (the + // new menu replaces the old one as the application's menu before that one is dropped). + if app.ui.language != self.language { + *self = Self::install(app); + } let now = designcraft_ui_egui::now_ms(); if now - self.last_refresh < 250.0 { return;