From 10d32f0b014c9507f093488caa4199503ecd0086 Mon Sep 17 00:00:00 2001 From: aiongg Date: Sun, 11 Oct 2026 14:13:23 +0000 Subject: [PATCH] Integration: Interface Language lives in Preferences on next's Russian and macOS menu bar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit prefs-language removes the Edit › Interface Language submenu; next added Russian and rebuilds the macOS menu bar when the language changes (#397). - de.rs and ru.rs drop their "Edit/Interface Language" path entries, as ja.rs does. - The Russian language test checks the Preferences list instead of the removed submenu. - app.language's params doc lists ru and says the macOS menu bar follows at once. - native_menu.rs: the rebuild comment names Preferences and Cancel, which change `app.ui.language` and so reach the same rebuild in `NativeMenu::poll`. --- apps/designcraft/src/native_menu.rs | 6 +++--- crates/ui-egui/src/i18n/de.rs | 1 - crates/ui-egui/src/i18n/ru.rs | 1 - crates/ui-egui/src/menus.rs | 8 ++------ 4 files changed, 5 insertions(+), 11 deletions(-) diff --git a/apps/designcraft/src/native_menu.rs b/apps/designcraft/src/native_menu.rs index 29d5a445a..9cacd03fc 100644 --- a/apps/designcraft/src/native_menu.rs +++ b/apps/designcraft/src/native_menu.rs @@ -87,9 +87,9 @@ impl NativeMenu { menus::activate_native(app, ctx, &cmd.clone(), ¶ms.clone()); } } - // Edit › Interface Language and Show CJK Features: 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). + // Interface Language and Show CJK Features (set in Preferences or by `app.language`, or put + // back by Cancel): 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.shown_for.0 || designcraft_ui_egui::cjk_features(app) != self.shown_for.1 { *self = Self::install(app); } diff --git a/crates/ui-egui/src/i18n/de.rs b/crates/ui-egui/src/i18n/de.rs index af4579a7f..806edf018 100644 --- a/crates/ui-egui/src/i18n/de.rs +++ b/crates/ui-egui/src/i18n/de.rs @@ -1585,7 +1585,6 @@ pub(super) const TABLE: &[(&str, &str)] = &[ ("Step and Repeat", "Duplizieren und versetzt einfügen"), ("Table of Contents", "Inhaltsverzeichnis"), ("Type on a Path Options", "Optionen für Text auf Pfad"), - ("Edit/Interface Language", "Bearbeiten/Sprache der Oberfläche"), ("Edit/Spelling", "Bearbeiten/Rechtschreibung"), ("Edit/Transparency Blend Space", "Bearbeiten/Transparenzfüllraum"), ("Edit/Transparency Flattener Presets", "Bearbeiten/Transparenzreduzierungsvorgaben"), diff --git a/crates/ui-egui/src/i18n/ru.rs b/crates/ui-egui/src/i18n/ru.rs index 4dfeb4d5b..d9adf2aca 100644 --- a/crates/ui-egui/src/i18n/ru.rs +++ b/crates/ui-egui/src/i18n/ru.rs @@ -1567,7 +1567,6 @@ pub(super) const TABLE: &[(&str, &str)] = &[ ("Step and Repeat", "Шаг и повтор"), ("Table of Contents", "Оглавление"), ("Type on a Path Options", "Параметры текста по контуру"), - ("Edit/Interface Language", "Редактирование/Язык интерфейса"), ("Edit/Spelling", "Редактирование/Орфография"), ("Edit/Transparency Blend Space", "Редактирование/Пространство наложения прозрачности"), ("Edit/Transparency Flattener Presets", "Редактирование/Стили сведения прозрачности"), diff --git a/crates/ui-egui/src/menus.rs b/crates/ui-egui/src/menus.rs index ad97245d5..d29e07845 100644 --- a/crates/ui-egui/src/menus.rs +++ b/crates/ui-egui/src/menus.rs @@ -48,7 +48,7 @@ pub const UI_COMMANDS: &[(&str, &str, Option<&str>, &str)] = &[ "app.language", "Interface Language", None, - "{lang?: \"\"|de|fr|es|ja|zh|ar|pt-br|it|uk} — menus and panel names (the macOS menu bar follows on the next launch); without lang, opens Preferences, where it is the first setting", + "{lang?: \"\"|de|fr|es|ja|zh|ar|pt-br|it|uk|ru} — menus and panel names (the macOS menu bar follows at once); without lang, opens Preferences, where it is the first setting", ), ( "app.flattener", @@ -3146,11 +3146,7 @@ mod tests { assert_eq!(restored.language, "ru"); assert_eq!(crate::i18n::tr(&restored.language, "File"), "Файл"); assert_eq!(crate::i18n::tr(&restored.language, "A custom name"), "A custom name"); - assert!(menu_tree().iter().flat_map(|(_, entries)| entries.iter()).any(|entry| { - matches!(entry, Item::Sub(label, children) if label == "Interface Language" && children.iter().any(|child| { - matches!(child, Item::Cmd { label, id, params, .. } if label == "Русский" && id == "app.language" && params["lang"] == "ru") - })) - })); + assert!(crate::i18n::LANGUAGES.contains(&("ru", "Русский")), "Preferences lists Russian by its own name"); } #[test]