mirror of
https://github.com/storytold/designcraft.git
synced 2026-11-11 16:30:16 -06:00
Integration: Interface Language lives in Preferences on next's Russian and macOS menu bar
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`.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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"),
|
||||
|
||||
@@ -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", "Редактирование/Стили сведения прозрачности"),
|
||||
|
||||
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user