DesignCraft: An open-source page and layout design editor written by scratch in pure Rust
Integration: Interface Language lives in Preferences on next's Russian and macOS menu bar
aiongg10d32f0b014c
diff --git a/apps/designcraft/src/native_menu.rs b/apps/designcraft/src/native_menu.rsindex 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.rsindex 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.rsindex 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.rsindex 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]