DesignCraft: An open-source page and layout design editor written by scratch in pure Rust
Merge branch 'main' into codex/hungarian-localization
macadminHU4ed5c7d9e6fb
diff --cc ROADMAP.mdindex 3d0b258d0,153555913..edf4c861b--- a/ROADMAP.md+++ b/ROADMAP.md@@@ -348,14 -356,37 +356,43 @@@ list) · [roadmap.md](docs/roadmap.md)## Progress log+- 2026-10-23 (HU1): repair localization test integration after merging main: restore separate all-catalog integrity, context-caption and numeral/count tests, retaining assertions from both branches; register Hungarian in the shared language and context catalogs. Retain 17 live labels missing from the known-label test list and remove 13 unused catalog entries (1,904 entries + four context captions remain).+Newest first.+ - **2026-10-24** · Custom-positioned anchored objects honour Relative to Spine (`anchored.options {spineRelative}`, IDML `SpineRelative`): the settings describe a left-hand page and mirror on a right-hand page, so marginal notes stay in the outside margin on both pages of a spread. On right-hand pages they took the left-hand placement and landed in the inside margin, across the spine or over the body text. No readiness percentage change.+ - **2026-10-23** · Save and export dialogs (Save As, Save a Copy, Export PDF and the other exports, Package, libraries and books) start in the active document's folder once it has been saved, and for a document never saved in the folder of the last file saved or exported, remembered across sessions (#1653). A folder deleted since falls back to the system's choice. No readiness percentage change.+ - **2026-10-22** · Autoflow (Shift-click with the loaded text cursor, autoflow on Place, `text.thread {autoflow}`) fills the pages that follow before it adds any, as InDesign does: one frame per column on each following page, whatever else the page holds, then new pages at the end of the document. It inserted pages right after the story's last frame, in front of the document's own pages. Frames it set past the end of the text go again; a page the document had stays, and a page autoflow added only for such a frame goes with it. Smart Text Reflow of the primary text frame is unchanged. No readiness percentage change.+ - **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-23** · Translations: a missing string shows in English and fails no test; `cargo xtask i18n-report`, run by `cargo xtask ci`, prints the missing strings per language. Tests keep duplicate-key and placeholder checks and the language mechanics (lookup, context captions, plural captions, right-to-left). 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-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-17** · PDF/X-4 export warns about fonts drawing visible text without an embedded+ font program, including placed PDF forms; `validate-pdf` reports the font and page (#909).+ Invisible OCR text is exempt. Detection only: fonts are not embedded or outlined automatically.+ Repeated forms reuse context-aware font findings; a document-wide operation limit and a form-nesting depth limit+ report incomplete checks instead of allowing excessive nested-form traversal.+ 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-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.diff --cc crates/ui-egui/src/i18n.rsindex f885e6929,bdca83589..0038833dc--- a/crates/ui-egui/src/i18n.rs+++ b/crates/ui-egui/src/i18n.rs@@@ -4467,22 -4465,18 +4467,22 @@@ pub fn tr<'a>(lang: &str, s: &'a str) -}fn lookup<'a>(lang: &str, s: &'a str) -> &'a str {- static GERMAN: OnceLock<HashMap<&'static str, &'static str>> = OnceLock::new();- static JAPANESE: OnceLock<HashMap<&'static str, &'static str>> = OnceLock::new();- static TRANSLATIONS: OnceLock<HashMap<&'static str, [&'static str; 5]>> = OnceLock::new();- static ARABIC: OnceLock<HashMap<&'static str, &'static str>> = OnceLock::new();- static UKRAINIAN: OnceLock<HashMap<&'static str, &'static str>> = OnceLock::new();- static PORTUGUESE_BR: OnceLock<HashMap<&'static str, &'static str>> = OnceLock::new();- static ITALIAN: OnceLock<HashMap<&'static str, &'static str>> = OnceLock::new();- static POLISH: OnceLock<HashMap<&'static str, &'static str>> = OnceLock::new();- static RUSSIAN: OnceLock<HashMap<&'static str, &'static str>> = OnceLock::new();- static CZECH: OnceLock<HashMap<&'static str, &'static str>> = OnceLock::new();- static FRENCH: OnceLock<HashMap<&'static str, &'static str>> = OnceLock::new();- static GEORGIAN: OnceLock<HashMap<&'static str, &'static str>> = OnceLock::new();- static HUNGARIAN: OnceLock<HashMap<&'static str, &'static str>> = OnceLock::new();+ static GERMAN: OnceLock<HashMap<&str, &str>> = OnceLock::new();+ static JAPANESE: OnceLock<HashMap<&str, &str>> = OnceLock::new();+ static TRANSLATIONS: OnceLock<HashMap<&str, [&str; 5]>> = OnceLock::new();+ static ARABIC: OnceLock<HashMap<&str, &str>> = OnceLock::new();+ static UKRAINIAN: OnceLock<HashMap<&str, &str>> = OnceLock::new();+ static PORTUGUESE_BR: OnceLock<HashMap<&str, &str>> = OnceLock::new();+ static ITALIAN: OnceLock<HashMap<&str, &str>> = OnceLock::new();+ static POLISH: OnceLock<HashMap<&str, &str>> = OnceLock::new();+ static RUSSIAN: OnceLock<HashMap<&str, &str>> = OnceLock::new();+ static CZECH: OnceLock<HashMap<&str, &str>> = OnceLock::new();+ static FRENCH: OnceLock<HashMap<&str, &str>> = OnceLock::new();+ static GEORGIAN: OnceLock<HashMap<&str, &str>> = OnceLock::new();++ static HUNGARIAN: OnceLock<HashMap<&str, &str>> = OnceLock::new();+ if lang == "hu" {+ return HUNGARIAN.get_or_init(|| hu::TABLE.iter().copied().collect()).get(s).copied().unwrap_or(s);+ }if lang == "ar" {return ARABIC.get_or_init(|| ar::TABLE.iter().copied().collect()).get(s).copied().unwrap_or(s);}@@@ -4809,40 -4713,20 +4809,51 @@@ mod tests}}+ #[test]+ 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);+ }+ assert_ne!(tr("ar", "Apply Parent to Pages"), "Apply Parent to Pages");+ }+- /// 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.+ /// The tables `tr` reads, as (language, key, translation), context captions included.+ fn entries() -> Vec<(&'static str, &'static str, &'static str)> {+ let mut entries: Vec<_> = LANGUAGE_TABLES.iter().flat_map(|(lang, table)| table.iter().map(|(key, text)| (*lang, *key, *text))).collect();+ 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))));+ }+ entries.extend(CONTEXT_TABLES.iter().flat_map(|(lang, table)| table.iter().map(|(key, _, text)| (*lang, *key, *text))));+ entries+ }++ /// Every catalog has one row per key and keeps the English placeholders. A string a catalog+ /// doesn't translate shows in English, so a missing or empty row fails nothing here; the+ /// `missing_translations_report` lists them.#[test]fn every_catalog_has_unique_keys_and_keeps_placeholders() {for (lang, i) in SHARED_COLUMNS.iter().zip(0..) {