DesignCraft: An open-source page and layout design editor written by scratch in pure Rust
Merge branch 'main' into codex/hungarian-localization
macadminHUb83e2cfaf8fa
diff --cc ROADMAP.mdindex 85827c924,d3ef17e47..d24f2e21e--- a/ROADMAP.md+++ b/ROADMAP.md@@@ -348,10 -348,33 +348,18 @@@ list) · [roadmap.md](docs/roadmap.md)Newest first.-- **2026-10-16** · Edit › Keyboard Shortcuts imports a set saved by InDesign's Show Set (.txt, Windows or Mac key names, UTF-8 or UTF-16): matched commands take its Default shortcuts or lose theirs, other commands give up keys it takes, and a report lists what it changed and the items it could not match (`window.importShortcuts`, #1180). Tool keys stay fixed. No readiness percentage change.-- **2026-10-22** · A ruler guide dragged with the Selection tools, out of a ruler, on its own or with other selected guides, snaps along its axis as objects do (#1221): to other ruler guides, margins, columns, bleed, page and object edges and centers (with the smart-guide mark) and the document grid, within the snap zone and following Snap to Guides and Smart Guides. Shift snaps to the ruler's ticks and Cmd suspends snapping. The preview line, the position readout and the drop use the same snapped position. No readiness percentage change.-- **2026-10-22** · macOS: the app menu has a Language submenu after Settings… with each interface language in its own name and the current one checked, as in the suite's other apps; Preferences › General › Interface Language stays. No readiness percentage change.-- **2026-10-22** · macOS menu bar: the menus keep working after the interface language or Show CJK Features changes (a rebuilt menu bar lost every click, Quit included), and its key equivalents are the shortcuts in effect, so a shortcut moved in the Keyboard Shortcuts editor leaves its old menu item. No readiness percentage change.-- **2026-10-22** · Paragraph rules: Rule Above's offset is measured from the first line's baseline to the rule's bottom edge, as in InDesign. Rules sat one ascent too high and crossed the previous paragraph's text (reported from an imported INDD document). No readiness percentage change.-- **2026-10-21** · Ruler guides are selected like objects (#1282): a click with the Selection tools selects a guide (also where it crosses an object), Shift-click adds or removes one, a new guide from the rulers is selected, a marquee that touches no object selects the guides it crosses, and Edit › Select All Guides (⌥⌘G, `guide.selectAll`) selects every unlocked guide on the spread. Selected guides draw thicker in their layer's color, drag together (all of them shown moving), nudge with the arrow keys and go with Delete, each as one undo step (`guide.select`, `guide.deselect`, `guide.moveBy`, `guide.delete {}`). With one guide selected the Control bar's X (vertical guide) or Y (horizontal guide) field and Properties › Transform show where it is, as the rulers measure, and typing a value moves it there. No readiness percentage change.-- **2026-10-16** · Selection: drag a column guide to move its gutter, as in InDesign (#1096). Both guides of the gutter move together and keep its width, stop at the neighbouring guides and the margins, and snap to the document grid, guides and objects, or with Shift to the ruler's tick marks; Escape cancels and the drag is one undo step. Locked column guides (the default) are not picked. A document page takes the result as its own columns; on a parent page it passes to the pages that follow it. `layout.moveColumnGuide` does the same over the control channel and MCP. No readiness percentage change.-- **2026-10-16** · Layout: autoflow, inserted pages and new parents follow dragged column guides (#1096). Autoflow sets one frame per dragged column and counts the pages it adds from them; Insert Pages and New Parent keep the custom positions with the column count and gutter; a page that moves to the other side of the spine (inserted, deleted or moved pages, Duplicate Spread, a new parent's other page) has them mirrored across its margin box, as InDesign does; `document.inspect` reports each page's gutter, column rects and whether its columns are custom. No readiness percentage change.-- **2026-10-16** · Layout: Margins and Columns keeps dragged column guides unless the column count or gutter changes (#1096). The dialog sends every field on OK, so a margin-only change re-divided the columns evenly. Margin changes keep the positions; the columns follow them only while they fit the margin box. No readiness percentage change.-- **2026-10-16** · Lock Guides and Lock Column Guides are commands in View ▸ Grids & Guides (`view.lockGuides`, ⌥⌘;, and `view.lockColumnGuides`), so the control channel and MCP reach them. Lock Column Guides is an undo step, is saved with the document, on in new ones, and read from and written to IDML's `ColumnGuideLocked`, which export always wrote as locked (#1096). No readiness percentage change.-- **2026-10-16** · IDML: a page keeps column guides that were dragged off centre (InDesign's Custom columns). They were divided evenly on import, so the gutter sprang back to the middle; the imported positions now place the columns, with the canvas guides, snapping and text placement following them, and they are written back on export. Layout › Margins and Columns re-divides them evenly when the count or gutter changes, as InDesign's does. No readiness percentage change.-- **2026-10-16** · IDML: custom column positions are checked before they are used (#1096). A set must give two edges per column, ascending from the left margin to the right one; any other (a wrong count, unsorted or non-numeric values, a list longer than 216 columns allow, or positions left behind by a margin or page-size change) is the even split, in the canvas, on import and on export, instead of columns drawn outside the margins. No readiness percentage change.-- **2026-10-16** · Type › Reload Fonts (`font.reload`): fonts installed, edited or removed while DesignCraft runs are read again without a restart, and the open documents recompose with them (#328, #547). An edited font file is noticed by its length and modification time; bundled, added and document fonts stay as they are. InDesign does this by itself, so noticing changes automatically is still open (gap 6). No readiness percentage change.-- **2026-10-16** · Parents can be deleted from their Pages-panel context menu or `layout.parents.delete {id}`. Applied-page and based-on references are cleared, local override copies survive, and Undo restores the parent. Addresses the deletion portion of #956; no readiness percentage change.-- **2026-10-17** · File › Package writes the document's and the IDML's links relative to the package (`Links/logo.png`, `file:Links/logo.png`), so a package holds no path from the machine that made it; opening a document resolves them to the files beside it. Links › Copy Link(s) To still links by full path. (#340). No readiness percentage change.-- **2026-10-18** · View › Screen Mode: Bleed and Slug do what they say. Both were selectable from the toolbar, the View menu and `view.screenMode` but drew the canvas exactly as Normal did, guides and all; they are preview modes now, and what each page shows reaches the bleed box or the slug box instead of stopping at the trim. The slug guide is drawn as well, in the Slug colour from Preferences › Guides & Pasteboard, which nothing had read. No readiness percentage change.-- **2026-10-17** · Object strokes reject malformed types and unknown type fields before changing the document; command help lists every stroke kind and its required fields. No readiness percentage change.-- **2026-10-17** · Docs: documented a persistent source CLI install with Cargo, MCP-client PATH setup and bare-name server registration in `docs/mcp.md`. No readiness percentage change.+- **2026-10-20** · HU1: Hungarian review corrections distinguish numbers/counts and text/grid columns (four context captions), consistently use formal address, and align menu paths with visible labels. Added context and menu-path regression coverage; corrected localization documentation. No readiness percentage change.++- **2026-10-17** · HU1: Hungarian (`hu` / Magyar) interface with 1,917 entries and two context captions, including tool names; AI-assisted and initially reviewed by a native DTP practitioner. Unknown/new strings remain English. Hungarian spelling and hyphenation remain follow-up work. No readiness percentage change.+ - **2026-10-16** · Selection: drag a column guide to move its gutter, as in InDesign (#1096). Both guides of the gutter move together and keep its width, stop at the neighbouring guides and the margins, and snap to the document grid, guides and objects, or with Shift to the ruler's tick marks; Escape cancels and the drag is one undo step. Locked column guides (the default) are not picked. A document page takes the result as its own columns; on a parent page it passes to the pages that follow it. `layout.moveColumnGuide` does the same over the control channel and MCP. No readiness percentage change.+ - **2026-10-16** · Layout: Margins and Columns keeps dragged column guides unless the column count or gutter changes (#1096). The dialog sends every field on OK, so a margin-only change re-divided the columns evenly. Margin changes keep the positions; the columns follow them only while they fit the margin box. No readiness percentage change.+ - **2026-10-16** · Layout: autoflow, inserted pages and new parents follow dragged column guides (#1096). Autoflow sets one frame per dragged column and counts the pages it adds from them; Insert Pages and New Parent keep the custom positions with the column count and gutter; `document.inspect` reports each page's gutter, column rects and whether its columns are custom. No readiness percentage change.+ - **2026-10-16** · Layout: autoflow, inserted pages and new parents follow dragged column guides (#1096). Autoflow sets one frame per dragged column and counts the pages it adds from them; Insert Pages and New Parent keep the custom positions with the column count and gutter; a page that moves to the other side of the spine (inserted, deleted or moved pages, Duplicate Spread, a new parent's other page) has them mirrored across its margin box, as InDesign does; `document.inspect` reports each page's gutter, column rects and whether its columns are custom. No readiness percentage change.+ - **2026-10-16** · IDML: custom column positions are checked before they are used (#1096). A set must give two edges per column, ascending from the left margin to the right one; any other (a wrong count, unsorted or non-numeric values, a list longer than 216 columns allow, or positions left behind by a margin or page-size change) is the even split, in the canvas, on import and on export, instead of columns drawn outside the margins. No readiness percentage change.+ - **2026-10-16** · IDML: a page keeps column guides that were dragged off centre (InDesign's Custom columns). They were divided evenly on import, so the gutter sprang back to the middle; the imported positions now place the columns, with the canvas guides, snapping and text placement following them, and they are written back on export. Layout › Margins and Columns re-divides them evenly when the count or gutter changes, as InDesign's does. No readiness percentage change.+ - **2026-10-16** · Lock Guides and Lock Column Guides are commands in View ▸ Grids & Guides (`view.lockGuides`, ⌥⌘;, and `view.lockColumnGuides`), so the control channel and MCP reach them. Lock Column Guides is saved with the document, on in new ones, and read from and written to IDML's `ColumnGuideLocked`, which export always wrote as locked (#1096). No readiness percentage change.+ - **2026-10-16** · Lock Guides and Lock Column Guides are commands in View ▸ Grids & Guides (`view.lockGuides`, ⌥⌘;, and `view.lockColumnGuides`), so the control channel and MCP reach them. Lock Column Guides is an undo step, is saved with the document, on in new ones, and read from and written to IDML's `ColumnGuideLocked`, which export always wrote as locked (#1096). No readiness percentage change.- **2026-10-16** · Threading: the loaded text cursor threads into a text frame inside a group (it hit the group and showed it could not thread); a plain click still selects the group (#1075). Gap 27 closed. No readiness percentage change.- **2026-10-16** · Greek text hyphenates. The patterns were never compiled in, so Greek set unhyphenated however narrow the column; `"Greek"`, `"Greek: Greece"`, `el` and `el-GR` all resolve now and ανθρωπος breaks αν-θρω-πος. They are the monotonic patterns (hyph-el-monoton, Dimitrios Filippou, under MIT), which is what polytonic text hyphenates by too. Five of InDesign's ~40 hyphenation languages. No readiness percentage change.- **2026-10-16** · A swatch applied to a placed greyscale or bitmap image colours it, as in InDesign: IDML's `<Image FillColor>` is read and written, greyscale pixels become a tint of the swatch on opaque white and a bitmap's white lets the frame show through, on screen and in PDF (spot swatches print on their plate). Colour images keep their colours. Applying the swatch from the Swatches panel comes next. No readiness percentage change.diff --cc crates/ui-egui/src/i18n.rsindex 18d0d9ea7,6057abc97..1fc7f4611--- a/crates/ui-egui/src/i18n.rs+++ b/crates/ui-egui/src/i18n.rs@@@ -4602,184 -4648,121 +4655,185 @@@ mod tests}assert_eq!(tr("", key), *key);}- for (key, expected) in de::TABLE {- assert_eq!(tr("de", key), *expected, "de: {key}");- }- for (key, expected) in ar::TABLE {- assert_eq!(tr("ar", key), *expected, "ar: {key}");- }- for (key, expected) in pt_br::TABLE {- assert_eq!(tr("pt-br", key), *expected, "pt-br: {key}");- }- for (key, expected) in it::TABLE {- assert_eq!(tr("it", key), *expected, "it: {key}");- }- for (key, expected) in uk::TABLE {- assert_eq!(tr("uk", key), *expected, "uk: {key}");- }- for (key, expected) in ru::TABLE {- assert_eq!(tr("ru", key), *expected, "ru: {key}");- }- for (key, expected) in cs::TABLE {- assert_eq!(tr("cs", key), *expected, "cs: {key}");- }- for (key, expected) in fr::TABLE {- assert_eq!(tr("fr", key), *expected, "fr: {key}");- }- for (key, expected) in pl::TABLE {- assert_eq!(tr("pl", key), *expected, "pl: {key}");- }- for (key, expected) in ka::TABLE {- assert_eq!(tr("ka", key), *expected, "ka: {key}");+ for (lang, table) in LANGUAGE_TABLES {+ for (key, expected) in *table {+ assert_eq!(tr(lang, key), *expected, "{lang}: {key}");+ assert_eq!(tr("", key), *key);+ }}- // Strings no catalog has stay as they are, in every language.+ for (key, expected) in hu::TABLE {+ assert_eq!(tr("hu", key), *expected, "hu: {key}");+ }let unknown = String::from("A user-defined untranslated label");- for lang in LANGUAGES.iter().map(|(code, _)| *code).chain(["en", "unknown"]) {- assert!(std::ptr::eq(tr(lang, &unknown), unknown.as_str()), "{lang}");- // Fixed standard names stay identical.- assert_eq!(tr(lang, "PDF/X-4"), "PDF/X-4", "{lang}");+ for lang in ["hu", "pl", "cs", "uk", "ru", "ar", "pt-br", "it", "ka", "zh", "ja", "de", "fr", "es", "", "unknown"] {+ assert!(std::ptr::eq(tr(lang, &unknown), unknown.as_str()));}}#[test]- fn context_captions_come_from_their_context_or_the_plain_translation() {- for (lang, table) in CONTEXT_TABLES {- for (key, scope, text) in *table {- assert_eq!(tr_context(lang, key, scope), *text, "{lang}: {key} ({scope})");- }+ fn hungarian_catalog_preserves_placeholders_context_and_counts() {+ let catalog: HashMap<_, _> = hu::TABLE.iter().copied().collect();+ assert_eq!(catalog.len(), hu::TABLE.len(), "duplicate Hungarian keys");+ let placeholders = |s: &str| {+ let mut names: Vec<_> = s.split('{').skip(1).filter_map(|part| part.split_once('}').map(|(name, _)| name.to_owned())).collect();+ names.sort();+ names+ };+ for (key, translation) in hu::TABLE {+ assert!(!translation.trim().is_empty(), "empty {key}");+ assert_eq!(placeholders(key), placeholders(translation), "placeholders: {key}");+ assert_eq!(key.ends_with('…'), translation.ends_with('…'), "ellipsis: {key}");+ }+ assert!(!is_rtl("hu"));+ assert_eq!(tr("hu", "File"), "Fájl");+ assert_eq!(tr("hu", "Bleed"), "Kifutó");+ assert_eq!(tr("hu", "Unknown label"), "Unknown label");+ assert_eq!(tr("hu", "Columns"), "Hasábok");+ assert_eq!(tr_context("hu", "Columns", "table"), "Oszlopok");+ assert_eq!(tr("hu", "Columns:"), "Hasábok:");+ assert_eq!(tr_context("hu", "Columns:", "grid"), "Oszlopok:");+ assert_eq!(tr_context("hu", "Columns:", "unknown"), "Hasábok:");+ assert_eq!(tr("hu", "Group"), "Csoportosítás");+ assert_eq!(tr_context("hu", "Group", "selection"), "Csoport");+ assert_eq!(tr_context("hu", "Columns", "unknown"), "Hasábok");+ assert_eq!(tr_context("", "Columns", "table"), "Columns");+ for n in [0, 1, 2, 5, 21] {+ assert_eq!(count_label("hu", "pages", n), format!("{n} oldal"));+ assert_eq!(count_label("hu", "objects", n), format!("{n} objektum"));+ assert_eq!(count_label("hu", "errors", n), format!("{n} hiba"));+ assert_eq!(+ tr("hu", "{pages} Pages in {spreads} Spreads").replace("{pages}", &n.to_string()).replace("{spreads}", &n.to_string()),+ format!("{n} oldal, {n} oldalpáron")+ );+ }+ assert_eq!(style_name("hu", "[Basic Paragraph]"), "[Alapbekezdés]");+ assert_eq!(style_name("hu", "Saját stílus"), "Saját stílus");+ assert_eq!(workspace_name("hu", "Essentials"), "Alapok");+ assert_eq!(workspace_name("hu", "Saját munkaterület"), "Saját munkaterület");+ }++ #[test]+ fn translates_known_strings_and_keeps_the_rest() {+ assert_eq!(tr("de", "File"), "Datei");+ assert_eq!(tr("ja", "Swatches"), "スウォッチ");+ assert_eq!(tr("fr", "Something new"), "Something new");+ assert_eq!(tr("", "File"), "File");+ assert_eq!(tr("ar", "File"), "ملف");+ assert_eq!(tr("ar", "Unknown label"), "Unknown label");+ assert_eq!(tr("pt-br", "File"), "Arquivo");+ assert_eq!(tr("pt-br", "New Document…"), "Novo documento…");+ assert_eq!(tr("pt-br", "Unknown label"), "Unknown label");+ assert_eq!(tr("it", "Edit"), "Modifica");+ assert_eq!(tr("it", "New Document…"), "Nuovo documento…");+ assert_eq!(tr("it", "Unknown label"), "Unknown label");+ assert!(is_rtl("ar"));+ for (i, (en, translation)) in ar::TABLE.iter().enumerate() {+ assert!(ar::TABLE[..i].iter().all(|(key, _)| key != en), "duplicate {en}");+ assert!(!translation.is_empty(), "{en}");+ }+ for (i, (en, translation)) in pt_br::TABLE.iter().enumerate() {+ assert!(pt_br::TABLE[..i].iter().all(|(key, _)| key != en), "duplicate {en}");+ assert!(!translation.is_empty(), "{en}");+ }+ for (i, (en, translation)) in it::TABLE.iter().enumerate() {+ assert!(it::TABLE[..i].iter().all(|(key, _)| key != en), "duplicate {en}");+ assert!(!translation.is_empty(), "{en}");}- // Italian entries are for keys the shared or Arabic table knows. A new English string- // falls back to English until it is translated, so it doesn't fail here.- for (en, _) in it::TABLE {- assert!(TABLE.iter().any(|(key, _)| key == en) || ar::TABLE.iter().any(|(key, _)| key == en), "it: unknown key {en}");+ for (key, scope, row) in CONTEXT {+ for (lang, shared) in SHARED_COLUMNS.into_iter().zip(row) {+ // A language's own context table is looked up before the shared one.+ let own = CONTEXT_TABLES+ .iter()+ .filter(|(code, _)| *code == lang)+ .flat_map(|(_, table)| table.iter())+ .find(|(k, s, _)| k == key && s == scope)+ .map(|(_, _, text)| *text);+ assert_eq!(tr_context(lang, key, scope), own.unwrap_or(*shared), "{lang}: {key} ({scope})");+ }}- // Every row is unique and complete.- for (i, (en, t)) in TABLE.iter().enumerate() {- assert!(TABLE[..i].iter().all(|(e, _)| e != en), "duplicate {en}");- assert!(t.iter().all(|x| !x.is_empty()), "{en}");+ // An unknown context, or a language without one, keeps the plain translation.+ let keys = CONTEXT.iter().map(|(key, _, _)| *key).chain(CONTEXT_TABLES.iter().flat_map(|(_, table)| table.iter().map(|(key, _, _)| *key)));+ for key in keys {+ for lang in LANGUAGES.iter().map(|(code, _)| *code).chain(["en"]) {+ assert_eq!(tr_context(lang, key, "no such context"), tr(lang, key), "{lang}: {key}");+ }+ assert_eq!(tr_context("", key, "count"), key);}}+ /// Every catalog: no duplicate or stale keys, no empty translations, and placeholders, padding,+ /// ellipses and label colons as in English. A string a catalog doesn't translate yet falls back+ /// to English, so missing translations don't fail here.#[test]- fn every_catalog_is_unique_current_and_keeps_placeholders_and_markers() {- // (language, key, translation) of every catalog, and every catalog's keys by name.- let mut entries: Vec<(&str, &str, &str)> = Vec::new();- let mut catalogs: Vec<(&str, HashSet<&str>)> = Vec::new();- for (lang, table) in LANGUAGE_TABLES {- let keys: HashSet<_> = table.iter().map(|(key, _)| *key).collect();- assert_eq!(keys.len(), table.len(), "{lang}: duplicate keys");- catalogs.push((*lang, keys));- entries.extend(table.iter().map(|(key, text)| (*lang, *key, *text)));+ fn a_column_count_and_a_list_number_read_differently() {+ for (lang, count, numeral) in [+ ("hu", "Darabszám:", "Szám:"),+ ("de", "Anzahl:", "Zahl:"),+ ("ja", "数:", "番号:"),+ ("uk", "Кількість:", "Номер:"),+ ("ar", "العدد:", "الرقم:"),+ ("fr", "Nombre :", "Numéro:"),+ ("zh", "数量:", "编号:"),+ ] {+ assert_eq!((tr_context(lang, "Number:", "count"), tr(lang, "Number:")), (count, numeral), "{lang}");}- assert_eq!(tr_context("en", "Number:", "count"), "Number:");- assert_eq!(tr("de", "Gutter:"), "Spaltenabstand:");- // The Pages panel menu.- for key in [- "Insert Pages…",- "Move Pages…",- "New Parent…",- "Override All Parent Page Items",- "Remove All Local Overrides",- "Detach All Objects from Parent",- "Create Alternate Layout…",- "Allow Selected Spread to Shuffle",- ] {- assert_ne!(tr("pt-br", key), key);+ let shared: HashSet<_> = TABLE.iter().map(|(key, _)| *key).collect();+ assert_eq!(shared.len(), TABLE.len(), "duplicate keys in the shared table");+ catalogs.push(("shared", shared.clone()));+ for (lang, i) in SHARED_COLUMNS.into_iter().zip(0..) {+ entries.extend(TABLE.iter().filter_map(|(key, row)| row.get(i).map(|text| (lang, *key, *text))));+ entries.extend(CONTEXT.iter().filter_map(|(key, _, row)| row.get(i).map(|text| (lang, *key, *text))));+ }+ let mut contexts = vec![("shared", CONTEXT.iter().map(|(key, scope, _)| (*key, *scope)).collect::<Vec<_>>())];+ for (lang, table) in CONTEXT_TABLES {+ contexts.push((*lang, table.iter().map(|(key, scope, _)| (*key, *scope)).collect()));+ entries.extend(table.iter().map(|(key, _, text)| (*lang, *key, *text)));}- assert_ne!(tr("ar", "Apply Parent to Pages"), "Apply Parent to Pages");- }- #[test]- fn french_catalog_has_no_duplicate_or_stale_keys_and_keeps_placeholders() {- let catalog: HashMap<_, _> = fr::TABLE.iter().copied().collect();- assert_eq!(catalog.len(), fr::TABLE.len(), "duplicate French keys");- let shared: std::collections::HashSet<_> = TABLE.iter().map(|(key, _)| *key).collect();- // `fr::TABLE` is looked up first: a key there would hide the shared table's French column.- let both: Vec<_> = catalog.keys().filter(|k| shared.contains(*k)).collect();- assert!(both.is_empty(), "French keys also in the shared table: {both:?}");- let mut keys = std::collections::HashSet::new();- for table in [ar::TABLE, de::TABLE, it::TABLE, ja::TABLE, pt_br::TABLE, uk::TABLE, ru::TABLE, cs::TABLE] {- keys.extend(table.iter().map(|(key, _)| *key));+ // A per-language table is looked up before the shared table, so a key in both hides the+ // shared column, except in the tables that translate the whole interface.+ for (lang, table) in LANGUAGE_TABLES.iter().filter(|(lang, _)| column(lang).is_some() && !WHOLE_INTERFACE.contains(lang)) {+ let both: Vec<_> = table.iter().map(|(key, _)| *key).filter(|key| shared.contains(key)).collect();+ assert!(both.is_empty(), "{lang} keys also in the shared table: {both:?}");}- let stale: Vec<_> = catalog.keys().filter(|k| !keys.contains(*k)).collect();- assert!(stale.is_empty(), "French entries for unknown keys: {stale:?}");- let placeholders = |s: &str| {- let mut names = s.split('{').skip(1).filter_map(|part| part.split_once('}').map(|(name, _)| name.to_owned())).collect::<Vec<_>>();- names.sort();++ // A key is current while the interface or another catalog has it.+ let interface = interface_strings();+ let current = |key: &str, own: &str| interface.contains(key) || catalogs.iter().any(|(name, keys)| *name != own && keys.contains(key));+ for (name, keys) in &catalogs {+ let mut stale: Vec<_> = keys.iter().filter(|key| !current(key, name)).collect();+ stale.sort();+ assert!(stale.is_empty(), "{name}: entries for unknown keys: {stale:?}");+ }+ for (name, keys) in &contexts {+ let unique: HashSet<_> = keys.iter().collect();+ assert_eq!(unique.len(), keys.len(), "{name}: duplicate context keys");+ let stale: Vec<_> = keys.iter().filter(|(key, _)| !current(key, "")).collect();+ assert!(stale.is_empty(), "{name}: contexts for unknown keys: {stale:?}");+ }++ let placeholders = |s: &'static str| {+ let mut names: Vec<_> = s.split('{').skip(1).filter_map(|part| part.split_once('}').map(|(name, _)| name)).collect();+ names.sort_unstable();names};- let shared_french = TABLE.iter().filter_map(|(key, row)| row.get(1).map(|text| (*key, *text)));- for (key, translation) in fr::TABLE.iter().copied().chain(shared_french) {- assert!(!translation.trim().is_empty(), "empty {key}");- assert_eq!(key.starts_with(' '), translation.starts_with(' '), "leading space: {key}");- assert_eq!(key.ends_with(' '), translation.ends_with(' '), "trailing space: {key}");- assert_eq!(placeholders(key), placeholders(translation), "placeholders: {key}");+ let ellipsis = |s: &str| s.ends_with('…') || s.ends_with("...");+ let colon = |s: &str| s.ends_with(':') || s.ends_with(':');+ // Full-width punctuation carries its own spacing.+ let full_width = |c: char| ('\u{3000}'..='\u{303F}').contains(&c) || ('\u{FF00}'..='\u{FFEF}').contains(&c);+ for (lang, key, text) in entries {+ assert!(!text.trim().is_empty(), "{lang}: empty translation of {key:?}");+ assert_eq!(placeholders(key), placeholders(text), "{lang}: placeholders of {key:?}");+ // Dialog ellipses, label colons and padded captions stay as in English.+ assert_eq!(ellipsis(key), ellipsis(text), "{lang}: ellipsis of {key:?}");+ assert_eq!(colon(key), colon(text), "{lang}: colon of {key:?}");+ if !text.starts_with(full_width) {+ assert_eq!(key.starts_with(' '), text.starts_with(' '), "{lang}: leading space of {key:?}");+ }+ if !text.ends_with(full_width) {+ assert_eq!(key.ends_with(' '), text.ends_with(' '), "{lang}: trailing space of {key:?}");+ }}- assert_eq!(tr("fr", "Group"), "Associer");}#[test]diff --cc crates/ui-egui/src/menus.rsindex 0048ad8ad,87537abd7..c71dd4a9c--- a/crates/ui-egui/src/menus.rs+++ b/crates/ui-egui/src/menus.rs@@@ -3310,28 -3373,8 +3373,24 @@@ mod testsassert_eq!((mode(&app, "normal"), mode(&app, "preview")), (Some(true), Some(false)));app.ui.screen_mode = crate::ScreenMode::Preview;assert_eq!((mode(&app, "normal"), mode(&app, "preview")), (Some(false), Some(true)));- // Every View submenu has its Japanese path (Edit › Menus shows them).- for path in submenu_paths("View") {- assert_ne!(crate::i18n::tr("ja", &path), path, "{path} has no Japanese row");- }}+ #[test]+ fn hungarian_menu_paths_match_the_visible_submenu_labels() {+ // These paths are displayed by menu customization; they must use the same+ // captions as the actual menu tree, including nested special characters.+ for title in ["Edit", "Type", "View"] {+ for path in submenu_paths(title) {+ let translated = crate::i18n::tr("hu", &path);+ if translated == path {+ continue; // New, uncatalogued paths still fall back to English.+ }+ let visible = path.split('/').map(|part| crate::i18n::tr("hu", part)).collect::<Vec<_>>().join("/");+ assert_eq!(translated, visible, "{path}");+ }+ }+ }+fn walk(items: &[Item], out: &mut Vec<(String, String, Value)>) {for it in items {match it {