From f484af750228b7e0374e27dd4247e52255757cfd Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 14 Nov 2026 17:17:16 -0800 Subject: [PATCH 1/5] i18n: banner hem and grommet errors and the recovery failure line have rows in every complete catalog Banner Hems and Grommets' errors, including its two shared range errors, and "{saving} failed: {e}" get @msg rows in the el, es, fr, hi, ka, vi, fi, ca and da catalogs. The message scan now follows a local given to `.status(name)` to the nearest `let` of that name in the same function, so the untranslated report lists the recovery failure lines that recovery.rs builds in a local before showing them. --- crates/ui-egui/src/i18n/ca.tsv | 12 +++++ crates/ui-egui/src/i18n/da.tsv | 12 +++++ crates/ui-egui/src/i18n/el.tsv | 12 +++++ crates/ui-egui/src/i18n/es.tsv | 10 ++++ crates/ui-egui/src/i18n/fi.tsv | 12 +++++ crates/ui-egui/src/i18n/fr.tsv | 10 ++++ crates/ui-egui/src/i18n/hi.tsv | 12 +++++ crates/ui-egui/src/i18n/ka.tsv | 12 +++++ crates/ui-egui/src/i18n/tests.rs | 84 +++++++++++++++++++++++++++++++- crates/ui-egui/src/i18n/vi.tsv | 12 +++++ docs/target-app-parity.md | 1 + 11 files changed, 188 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index ab50e14a58..2e4d253cd6 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -7504,6 +7504,18 @@ breakText Glyphs Glifs Margin Marge Box Caixa Swatch Mostra +@msg `spacing` must be more than 0 and at most {MAX_DISTANCE} pt `spacing` ha de ser més gran que 0 i com a màxim {MAX_DISTANCE} pt +@msg `{key}` must be from 0 to {MAX_DISTANCE} pt `{key}` ha d’estar entre 0 i {MAX_DISTANCE} pt +@msg `{key}` must be from 0.01 to 1000 pt `{key}` ha d’estar entre 0,01 i 1000 pt +@msg select the banner, or mark every artboard seleccioneu la pancarta o marqueu tots els taulers +@msg the banner has no width or height la pancarta no té amplada ni alçada +@msg the grommet inset is too large for the banner la distància dels ullets a la vora és massa gran per a la pancarta +@msg the hem is too deep for the banner la vora és massa profunda per a la pancarta +@msg the spacing makes more than {MAX_GROMMETS} grommets l’espaiat genera més de {MAX_GROMMETS} ullets +@msg there is no banner to mark no hi ha cap pancarta per marcar +@msg turn on at least one side activeu almenys un costat +@msg with no hem and no grommets there is nothing to mark sense vora ni ullets no hi ha res per marcar +@msg {saving} failed: {e} {saving} ha fallat: {e} Banner Hems and Grommets… Vores i ullets de pancarta… Banner Hems and Grommets Vores i ullets de pancarta Hem Vora diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index 59ce36d15f..ba23d8a5f2 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -7533,6 +7533,18 @@ breakText Glyphs Glyffer Box Ramme Swatch Farveprøve Direction Retning +@msg `spacing` must be more than 0 and at most {MAX_DISTANCE} pt `spacing` skal være større end 0 og højst {MAX_DISTANCE} pt +@msg `{key}` must be from 0 to {MAX_DISTANCE} pt `{key}` skal være fra 0 til {MAX_DISTANCE} pt +@msg `{key}` must be from 0.01 to 1000 pt `{key}` skal være fra 0,01 til 1000 pt +@msg select the banner, or mark every artboard markér banneret, eller afmærk alle tegneflader +@msg the banner has no width or height banneret har ingen bredde eller højde +@msg the grommet inset is too large for the banner maljernes afstand fra kanten er for stor til banneret +@msg the hem is too deep for the banner sømmen er for dyb til banneret +@msg the spacing makes more than {MAX_GROMMETS} grommets mellemrummet giver mere end {MAX_GROMMETS} maljer +@msg there is no banner to mark der er intet banner at afmærke +@msg turn on at least one side slå mindst én side til +@msg with no hem and no grommets there is nothing to mark uden søm og uden maljer er der intet at afmærke +@msg {saving} failed: {e} {saving} mislykkedes: {e} Banner Hems and Grommets… Bannersømme og maljer… Banner Hems and Grommets Bannersømme og maljer Hem Søm diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index a89d3c72e4..0b3b14a05b 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -7476,6 +7476,18 @@ breakText Glyphs Γλύφοι Margin Περιθώριο Box Πλαίσιο Swatch Δείγμα χρώματος +@msg `spacing` must be more than 0 and at most {MAX_DISTANCE} pt το `spacing` πρέπει να είναι μεγαλύτερο από 0 και το πολύ {MAX_DISTANCE} pt +@msg `{key}` must be from 0 to {MAX_DISTANCE} pt το `{key}` πρέπει να είναι από 0 έως {MAX_DISTANCE} pt +@msg `{key}` must be from 0.01 to 1000 pt το `{key}` πρέπει να είναι από 0,01 έως 1000 pt +@msg select the banner, or mark every artboard επιλέξτε το πανό ή σημειώστε όλους τους πίνακες σχεδίασης +@msg the banner has no width or height το πανό δεν έχει πλάτος ή ύψος +@msg the grommet inset is too large for the banner η απόσταση των τρουκς από την άκρη είναι πολύ μεγάλη για το πανό +@msg the hem is too deep for the banner το στρίφωμα είναι πολύ βαθύ για το πανό +@msg the spacing makes more than {MAX_GROMMETS} grommets το διάστημα δημιουργεί περισσότερα από {MAX_GROMMETS} τρουκς +@msg there is no banner to mark δεν υπάρχει πανό για σήμανση +@msg turn on at least one side ενεργοποιήστε τουλάχιστον μία πλευρά +@msg with no hem and no grommets there is nothing to mark χωρίς στρίφωμα και χωρίς τρουκς δεν υπάρχει τίποτα για σήμανση +@msg {saving} failed: {e} {saving}: απέτυχε: {e} Banner Hems and Grommets… Στριφώματα και τρουκς πανό… Banner Hems and Grommets Στριφώματα και τρουκς πανό Hem Στρίφωμα diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index 4a912f8005..c98833bb02 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -7583,6 +7583,16 @@ breakText Glyphs Glifos Margin Margen Box Caja Swatch Muestra +@msg `{key}` must be from 0.01 to 1000 pt `{key}` debe estar entre 0,01 y 1000 pt +@msg select the banner, or mark every artboard seleccione la pancarta o marque todas las mesas de trabajo +@msg the banner has no width or height la pancarta no tiene anchura ni altura +@msg the grommet inset is too large for the banner la distancia de los ojales al borde es demasiado grande para la pancarta +@msg the hem is too deep for the banner el dobladillo es demasiado profundo para la pancarta +@msg the spacing makes more than {MAX_GROMMETS} grommets el espaciado genera más de {MAX_GROMMETS} ojales +@msg there is no banner to mark no hay ninguna pancarta que marcar +@msg turn on at least one side active al menos un lado +@msg with no hem and no grommets there is nothing to mark sin dobladillo ni ojales no hay nada que marcar +@msg {saving} failed: {e} {saving} falló: {e} Banner Hems and Grommets… Dobladillos y ojales de pancarta… Banner Hems and Grommets Dobladillos y ojales de pancarta Hem Dobladillo diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index 06499d13ea..a283b3d4fb 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -7558,6 +7558,18 @@ breakText Glyphs Merkit Margin Marginaali Box Kehys Swatch Värimalli +@msg `spacing` must be more than 0 and at most {MAX_DISTANCE} pt `spacing`-arvon on oltava yli 0 ja enintään {MAX_DISTANCE} pt +@msg `{key}` must be from 0 to {MAX_DISTANCE} pt `{key}`-arvon on oltava väliltä 0–{MAX_DISTANCE} pt +@msg `{key}` must be from 0.01 to 1000 pt `{key}`-arvon on oltava väliltä 0,01–1000 pt +@msg select the banner, or mark every artboard valitse banneri tai merkitse kaikki piirtoalustat +@msg the banner has no width or height bannerilla ei ole leveyttä eikä korkeutta +@msg the grommet inset is too large for the banner purjerenkaiden etäisyys reunasta on liian suuri bannerille +@msg the hem is too deep for the banner päärme on liian syvä bannerille +@msg the spacing makes more than {MAX_GROMMETS} grommets välistyksellä tulisi yli {MAX_GROMMETS} purjerengasta +@msg there is no banner to mark merkittävää banneria ei ole +@msg turn on at least one side ota käyttöön vähintään yksi sivu +@msg with no hem and no grommets there is nothing to mark ilman päärmettä ja purjerenkaita ei ole mitään merkittävää +@msg {saving} failed: {e} {saving} epäonnistui: {e} Banner Hems and Grommets… Bannerin päärmeet ja purjerenkaat… Banner Hems and Grommets Bannerin päärmeet ja purjerenkaat Hem Päärme diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 90882cf105..ae122c1302 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -9322,6 +9322,16 @@ breakText Glyphs Glyphes @msg the paths are too many or too tangled to find where they cross les tracés sont trop nombreux ou trop enchevêtrés pour trouver où ils se croisent @msg the rectangle or line reaches too many paths to check le rectangle ou la ligne atteint trop de tracés pour être vérifié @msg {name} must be a number {name} doit être un nombre +@msg `{key}` must be from 0.01 to 1000 pt `{key}` doit être compris entre 0,01 et 1000 pt +@msg select the banner, or mark every artboard sélectionnez la banderole ou marquez tous les plans de travail +@msg the banner has no width or height la banderole n’a ni largeur ni hauteur +@msg the grommet inset is too large for the banner la distance des œillets au bord est trop grande pour la banderole +@msg the hem is too deep for the banner l’ourlet est trop profond pour la banderole +@msg the spacing makes more than {MAX_GROMMETS} grommets l’espacement produit plus de {MAX_GROMMETS} œillets +@msg there is no banner to mark il n’y a aucune banderole à marquer +@msg turn on at least one side activez au moins un côté +@msg with no hem and no grommets there is nothing to mark sans ourlet ni œillets, il n’y a rien à marquer +@msg {saving} failed: {e} {saving} : échec : {e} Banner Hems and Grommets… Ourlets et œillets de banderole… Banner Hems and Grommets Ourlets et œillets de banderole Hem Ourlet diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index 671052e82b..118e49fe16 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -8914,6 +8914,18 @@ theme Appearance अपीयरेंस Margin मार्जिन Box बॉक्स Swatch स्वॉच +@msg `spacing` must be more than 0 and at most {MAX_DISTANCE} pt `spacing` 0 से अधिक और अधिकतम {MAX_DISTANCE} pt होना चाहिए +@msg `{key}` must be from 0 to {MAX_DISTANCE} pt `{key}` 0 से {MAX_DISTANCE} pt तक होना चाहिए +@msg `{key}` must be from 0.01 to 1000 pt `{key}` 0.01 से 1000 pt तक होना चाहिए +@msg select the banner, or mark every artboard बैनर चुनें, या हर आर्टबोर्ड को मार्क करें +@msg the banner has no width or height बैनर की कोई चौड़ाई या ऊँचाई नहीं है +@msg the grommet inset is too large for the banner बैनर के लिए किनारे से आईलेट की दूरी बहुत अधिक है +@msg the hem is too deep for the banner बैनर के लिए हेम बहुत गहरा है +@msg the spacing makes more than {MAX_GROMMETS} grommets इस स्पेसिंग से {MAX_GROMMETS} से अधिक आईलेट बनते हैं +@msg there is no banner to mark मार्क करने के लिए कोई बैनर नहीं है +@msg turn on at least one side कम से कम एक साइड चालू करें +@msg with no hem and no grommets there is nothing to mark बिना हेम और बिना आईलेट के मार्क करने के लिए कुछ नहीं है +@msg {saving} failed: {e} {saving} विफल: {e} Banner Hems and Grommets… बैनर हेम और आईलेट… Banner Hems and Grommets बैनर हेम और आईलेट Hem हेम diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index 8c42eafaf1..55b186a76f 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -7637,6 +7637,18 @@ font-script Japanese იაპონური Margin ზღვარი Box ჩარჩო Swatch ფერის ნიმუში +@msg `spacing` must be more than 0 and at most {MAX_DISTANCE} pt `spacing` უნდა იყოს 0-ზე მეტი და არაუმეტეს {MAX_DISTANCE} pt +@msg `{key}` must be from 0 to {MAX_DISTANCE} pt `{key}` უნდა იყოს 0-დან {MAX_DISTANCE} pt-მდე +@msg `{key}` must be from 0.01 to 1000 pt `{key}` უნდა იყოს 0,01-დან 1000 pt-მდე +@msg select the banner, or mark every artboard აირჩიეთ ბანერი ან მონიშნეთ ყველა სამუშაო დაფა +@msg the banner has no width or height ბანერს არ აქვს სიგანე ან სიმაღლე +@msg the grommet inset is too large for the banner ლუვერების დაშორება კიდიდან ზედმეტად დიდია ბანერისთვის +@msg the hem is too deep for the banner ნაკეცი ზედმეტად ღრმაა ბანერისთვის +@msg the spacing makes more than {MAX_GROMMETS} grommets ამ ინტერვალით {MAX_GROMMETS}-ზე მეტი ლუვერი გამოდის +@msg there is no banner to mark მოსანიშნი ბანერი არ არის +@msg turn on at least one side ჩართეთ ერთი მხარე მაინც +@msg with no hem and no grommets there is nothing to mark ნაკეცისა და ლუვერების გარეშე მოსანიშნი არაფერია +@msg {saving} failed: {e} {saving} ვერ შესრულდა: {e} Banner Hems and Grommets… ბანერის ნაკეცები და ლუვერები… Banner Hems and Grommets ბანერის ნაკეცები და ლუვერები Hem ნაკეცი diff --git a/crates/ui-egui/src/i18n/tests.rs b/crates/ui-egui/src/i18n/tests.rs index 7fc16807ec..9535564181 100644 --- a/crates/ui-egui/src/i18n/tests.rs +++ b/crates/ui-egui/src/i18n/tests.rs @@ -2374,6 +2374,27 @@ fn plugin_messages_are_translated_in_every_complete_catalog() { assert!(missing.is_empty(), "{} plug-in messages have no @msg row:\n{}", missing.len(), missing.join("\n")); } +/// Banner Hems and Grommets' errors and the status of a recovery copy that failed without a folder +/// to name have an `@msg` row in every complete-message catalog. +#[test] +fn banner_and_recovery_messages_are_translated_in_every_complete_catalog() { + let path = std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("../engine/src/cmd/addons/cutting/banner.rs"); + let code = std::fs::read_to_string(&path).unwrap_or_default(); + let mut messages = source_messages(without_test_module(&code), &[("bad(", 1)], &std::collections::BTreeMap::new()); + assert!(messages.len() >= 11, "scan found only {} banner messages: {messages:?}", messages.len()); + let recovery = "{saving} failed: {e}"; + assert!(message_literals_in(&["ui-egui"]).contains(recovery), "the scan skips {recovery:?}"); + messages.push(recovery.to_string()); + let mut missing = vec![]; + for code in COMPLETE_MESSAGES { + let lang = Lang::from_code(code).expect("registered"); + let (entries, _) = parse_entries(lang.0.source); + let rows: std::collections::BTreeSet<&str> = entries.iter().filter(|(ctx, _, _)| ctx == "@msg").map(|(_, src, _)| src.as_str()).collect(); + missing.extend(messages.iter().filter(|m| !rows.contains(m.as_str())).map(|m| format!("{code}: {m}"))); + } + assert!(missing.is_empty(), "{} banner and recovery messages have no @msg row:\n{}", missing.len(), missing.join("\n")); +} + /// Errors the plug-in host returns are translated whole in every complete-message catalog, the /// reason inside the error's kind included, and keep their numbers, JSON shapes, permission names /// and nested reasons as written. @@ -3030,6 +3051,42 @@ fn unreadable(e: impl std::fmt::Display) -> String { assert!(message_literals_in(&["engine"]).contains("Data Recovery can't keep copies in {path}: {e}")); } +/// The scan reads the values of a local that a `.status(name)` shows, from the nearest `let` of +/// that name in the same function: a `format!` string and each arm of a `match`. It skips a local +/// that no status shows, a `let` of the name in another function, and a status given a value. +#[test] +fn message_scan_reads_locals_given_to_a_status() { + let code = r#" +fn other() { + let line = format!("the other function's line: {e}"); + log(line); +} + +fn saved(app: &mut App, saving: &str, e: &str, place: Option<&str>) { + let unused = format!("a line no status shows: {e}"); + let line = format!("{saving} failed: {e}"); + app.status(line); + let line = match place { + Some(folder) => format!("Couldn't save to {folder}: {e}"), + None => "Couldn't save".to_string(), + }; + log(&line); + app.status(line); + app.status(true); +} +"#; + let want = ["{saving} failed: {e}", "Couldn't save to {folder}: {e}", "Couldn't save"]; + assert_eq!(source_messages(code, &[], &std::collections::BTreeMap::new()), want); + let ui = message_literals_in(&["ui-egui"]); + for m in [ + "{saving} failed: {e}", + "Couldn't save recovery data for {title}: {e}. Copies go to {folder}, the folder set in Preferences; to use another folder, set Preferences → File Handling → Data Recovery → Folder (recoveryFolder)", + "Couldn't save recovery data for {title}: {e}. Copies go to {folder}, the default recovery folder; to use another folder, set Preferences → File Handling → Data Recovery → Folder (recoveryFolder)", + ] { + assert!(ui.contains(m), "the scan skips {m:?}"); + } +} + /// The scan stops at a test module whose `cfg` is `test` or `all(test, …)`, and reads on past a /// declaration of a test file and a module that is not only for tests. #[test] @@ -4477,6 +4534,7 @@ fn named_const<'a>(rest: &str, consts: &'a std::collections::BTreeMap(code: &'a str, name: &str) -> Vec<&'a str> { out } +/// Where each value of a local that a `.status(name)` in `code` shows can start: the statement of +/// the nearest `let name = ` before that call in the same function (`let line = format!("…");`, +/// `let line = match place { … };`, up to its `;`), read as [`closure_returns`] reads a closure. A +/// local that no `.status(name)` shows is not read. +fn status_locals(code: &str) -> Vec<&str> { + let mut out = vec![]; + for (at, m) in code.match_indices(".status(") { + let rest = &code[at + m.len()..]; + let name = &rest[..rest.find(|c: char| !c.is_ascii_alphanumeric() && c != '_').unwrap_or(rest.len())]; + if !name.starts_with(|c: char| c.is_ascii_lowercase() || c == '_') || !rest[name.len()..].starts_with(')') { + continue; + } + let bound = format!("let {name} = "); + let nearest = code[..at].rmatch_indices(bound.as_str()).find(|&(b, _)| !code[..b].ends_with(|c: char| c.is_alphanumeric() || c == '_')); + if let Some((b, _)) = nearest + && !code[b..at].contains("fn ") + { + out.extend(closure_returns(statement(&code[b + bound.len()..]))); + } + } + out +} + /// The statement `code` starts with, up to its `;` or the bracket that closes the block it is in. fn statement(code: &str) -> &str { let (mut depth, mut chars) = (0usize, code.char_indices()); diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index 16c613874c..3ffc077e69 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -7134,6 +7134,18 @@ breakText Glyphs Glyph Margin Lề Box Khung Swatch Mẫu màu +@msg `spacing` must be more than 0 and at most {MAX_DISTANCE} pt `spacing` phải lớn hơn 0 và tối đa {MAX_DISTANCE} pt +@msg `{key}` must be from 0 to {MAX_DISTANCE} pt `{key}` phải từ 0 đến {MAX_DISTANCE} pt +@msg `{key}` must be from 0.01 to 1000 pt `{key}` phải từ 0,01 đến 1000 pt +@msg select the banner, or mark every artboard hãy chọn băng rôn, hoặc đánh dấu mọi bảng vẽ +@msg the banner has no width or height băng rôn không có chiều rộng hoặc chiều cao +@msg the grommet inset is too large for the banner khoảng cách từ mép đến khoen quá lớn so với băng rôn +@msg the hem is too deep for the banner viền gấp quá sâu so với băng rôn +@msg the spacing makes more than {MAX_GROMMETS} grommets khoảng cách này tạo ra hơn {MAX_GROMMETS} khoen +@msg there is no banner to mark không có băng rôn nào để đánh dấu +@msg turn on at least one side hãy bật ít nhất một cạnh +@msg with no hem and no grommets there is nothing to mark không có viền gấp và khoen thì không có gì để đánh dấu +@msg {saving} failed: {e} {saving} thất bại: {e} Banner Hems and Grommets… Viền gấp và khoen băng rôn… Banner Hems and Grommets Viền gấp và khoen băng rôn Hem Viền gấp diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index c6972468cc..e100690fae 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -921,6 +921,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - The Polish catalog (`crates/ui-egui/src/i18n/pl.tsv`) has an `@msg` row for the status and error messages the untranslated report (`untranslated_report`) finds in the sources, 3,439 `@msg` rows in all: the errors of commands, scripts, file import and export and plug-ins. The report lists 46 Polish messages: 44 that open #7211, #7214, #7116, #7330 and #1931 translate, and 2 that no language has a row for. A message with two placeholders in a row (`Template::parse` in `crates/ui-egui/src/i18n/catalog.rs`) is still shown in English. - The status bar translates the limits a plug-in run can exceed (its instruction, time and memory budgets and its output size) and the error of a plug-in removal that leaves the plug-in's grant in the plug-in store, in every language that translates every message. The untranslated-strings report also lists messages that an error or a status takes from a `&str` constant (`plugin_limit_errors_are_translated`, `message_scan_reads_messages_held_in_constants`). - The status bar translates the plug-in host's other errors (manifest, module and run checks, the output an importer, exporter or effect returns, and the approval a plug-in's permissions need) in every language that translates every message. A JSON object or array inside a message stays as written, and a message that wraps another one, such as `plug-in manifest: {0}`, is matched by its own row before a row that starts with a placeholder. The reasons inside these errors (what is wrong with a parameter's spec or dialog keys, the value a parameter needs, what is wrong with an object, stroke, paint or effect in a plug-in's output) are translated with them, and the untranslated-strings report lists the reasons the plug-in host's error helpers take (`plugin_messages_are_translated_in_every_complete_catalog`, `plugin_errors_translate_with_their_values`, `plugin_error_reasons_are_translated_with_the_error`, `message_scan_reads_plugin_helpers`, `templates_that_start_with_text_match_first`). + - The status bar translates the errors of Object › Plug-ins › Cutting Tools › Banner Hems and Grommets… and the line for a recovery copy that fails in a store with no folder to name (`{saving} failed: {e}`) in every language that translates every message. The untranslated-strings report also lists the messages a status takes from a local variable, such as the recovery folder errors (`banner_and_recovery_messages_are_translated_in_every_complete_catalog`, `message_scan_reads_locals_given_to_a_status`). - The Japanese catalog (`crates/ui-egui/src/i18n/ja.tsv`) has 3,562 `@msg` rows and 49 `@msgplural` rows (counted 2026-11-14). The untranslated report (`untranslated_report`) lists 98 status and error messages in the sources that have no Japanese row: 77 that every complete-message language lacks, and 21 more. Open #7211 translates 34 of them, among them the composite font errors, and open #7116 translates the justification order error. The status bar does not use the rows for ``unknown parameter `{within}{key}`; {why}`` and `{name} must be {lo}–{hi}{unit} (got {v})`, because a message with two placeholders in a row cannot be matched (`Template::parse` in `crates/ui-egui/src/i18n/catalog.rs`). The row for `{k} has control characters{_1}` does not match the File Info error for a multi-line field, where the last placeholder is empty. A native speaker has not reviewed the wording. - A status or error message whose braces are literal, such as a plug-in's `expected {"objects": [...]}` or a command's `quotes must be {double?, single?}`, is translated only when the whole message matches its row: the row writes those braces doubled and has no placeholder, so it no longer replaces a different message that starts with the same words, such as a JSON reason `expected value at line 1 column 1`, which stays in English. A row without placeholders is found at any message length (`plain_message_keys_double_their_braces`, `literal_brace_rows_match_only_their_message`). - The status bar translates the errors a script's `File` and `Folder` objects, `vc.run`, `$.evalFile`, the `$` object's properties and functions, `alert`, `confirm` and `prompt`, `vc.document` and `vc.log` raise, the limits a run can pass, and the errors of Drop Script Engine, and the line for a run that fails (a syntax error, a thrown error, a limit, a stop or an internal error, with the script's name, the line and column, the included file it is in and the files left written), in every language that translates every message. The script's name, paths, numbers, command ids and the text a script throws itself are shown as they are. A failure with no line and column, such as an error in code `eval` compiled, is shown with one colon after the script's name (`an_error_without_a_place_names_the_script_and_kind`). A message template that names a value twice matches only when both places hold the same text, so the line for a failed run is not taken for the message inside it (`a_repeated_placeholder_matches_the_same_text`). The untranslated-strings report also lists the messages the script host's `fail`, `value` and `over` helpers take and the errors the script interpreter throws, and a constant's text comes from the file or crate that declares it, so the Scripts menu's headers are not listed as messages (`script_errors_are_translated`, `script_host_errors_are_translated`, `message_scan_reads_script_interpreter_errors`, `message_scan_reads_constants_of_the_file_and_its_crate`, `message_scan_skips_test_modules_with_any_test_cfg`). From 6c787eb784a4b4c8b8ecc6137eab8426324200de Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 15 Nov 2026 06:59:59 -0800 Subject: [PATCH 2/5] i18n: Georgian keeps one row for each banner message main now carries Georgian rows for the Banner Hems and Grommets errors and the shared distance and size range errors. Keep those rows and add only the recovery row `{saving} failed: {e}`, so the catalog has no duplicate rows for these messages. --- crates/ui-egui/src/i18n/ka.tsv | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index 516595296f..999486bdae 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -9865,17 +9865,6 @@ font-script Japanese იაპონური Margin ზღვარი Box ჩარჩო Swatch ფერის ნიმუში -@msg `spacing` must be more than 0 and at most {MAX_DISTANCE} pt `spacing` უნდა იყოს 0-ზე მეტი და არაუმეტეს {MAX_DISTANCE} pt -@msg `{key}` must be from 0 to {MAX_DISTANCE} pt `{key}` უნდა იყოს 0-დან {MAX_DISTANCE} pt-მდე -@msg `{key}` must be from 0.01 to 1000 pt `{key}` უნდა იყოს 0,01-დან 1000 pt-მდე -@msg select the banner, or mark every artboard აირჩიეთ ბანერი ან მონიშნეთ ყველა სამუშაო დაფა -@msg the banner has no width or height ბანერს არ აქვს სიგანე ან სიმაღლე -@msg the grommet inset is too large for the banner ლუვერების დაშორება კიდიდან ზედმეტად დიდია ბანერისთვის -@msg the hem is too deep for the banner ნაკეცი ზედმეტად ღრმაა ბანერისთვის -@msg the spacing makes more than {MAX_GROMMETS} grommets ამ ინტერვალით {MAX_GROMMETS}-ზე მეტი ლუვერი გამოდის -@msg there is no banner to mark მოსანიშნი ბანერი არ არის -@msg turn on at least one side ჩართეთ ერთი მხარე მაინც -@msg with no hem and no grommets there is nothing to mark ნაკეცისა და ლუვერების გარეშე მოსანიშნი არაფერია @msg {saving} failed: {e} {saving} ვერ შესრულდა: {e} Banner Hems and Grommets… ბანერის ნაკეცები და ლუვერები… Banner Hems and Grommets ბანერის ნაკეცები და ლუვერები From 1e18a7e9fc77ff4deba2f45139ea248723ded7b2 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Fri, 20 Nov 2026 16:31:59 -0800 Subject: [PATCH 3/5] i18n: Indonesian translates the banner hem and grommet errors and the save failure Indonesian joined the complete-message languages on main, so it needs the twelve banner and recovery rows the other complete catalogs carry. --- crates/ui-egui/src/i18n/id.tsv | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index 924d3d80b5..7e066a4494 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -8579,6 +8579,18 @@ breakText Glyphs Glif Box Kotak Swatch Sampel warna Direction Arah +@msg `spacing` must be more than 0 and at most {MAX_DISTANCE} pt `spacing` harus lebih dari 0 dan paling besar {MAX_DISTANCE} pt +@msg `{key}` must be from 0 to {MAX_DISTANCE} pt `{key}` harus dari 0 sampai {MAX_DISTANCE} pt +@msg `{key}` must be from 0.01 to 1000 pt `{key}` harus dari 0,01 sampai 1000 pt +@msg select the banner, or mark every artboard seleksi spanduk, atau tandai setiap artboard +@msg the banner has no width or height spanduk tidak memiliki lebar atau tinggi +@msg the grommet inset is too large for the banner jarak mata ayam dari tepi terlalu besar untuk spanduk +@msg the hem is too deep for the banner lipatan terlalu dalam untuk spanduk +@msg the spacing makes more than {MAX_GROMMETS} grommets spasi ini menghasilkan lebih dari {MAX_GROMMETS} mata ayam +@msg there is no banner to mark tidak ada spanduk untuk ditandai +@msg turn on at least one side aktifkan setidaknya satu sisi +@msg with no hem and no grommets there is nothing to mark tanpa lipatan dan tanpa mata ayam tidak ada yang perlu ditandai +@msg {saving} failed: {e} {saving} gagal: {e} Banner Hems and Grommets… Lipatan dan Mata Ayam Spanduk… Banner Hems and Grommets Lipatan dan Mata Ayam Spanduk Hem Lipatan From 4cf72518e1b48edd0383791b979a0f21b973a2e0 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Fri, 20 Nov 2026 19:37:40 -0800 Subject: [PATCH 4/5] i18n: the message scan skips a status local bound in a block that has ended status_locals took the nearest `let name = ` before a `.status(name)` call, even when that `let` was in an inner block that closed before the call. For `let note = "Outer"; { let note = "Inner"; log(note); } app.status(note);` the untranslated-strings report listed "Inner" and missed "Outer". The scan now skips a binding whose block a `}` closes before the call. Braces inside string and character literals are skipped with quoted_end, the helper without_comments already uses. message_scan_reads_locals_given_to_a_status covers the shadowing case and a status local followed by brace literals. --- crates/ui-egui/src/i18n/tests.rs | 55 ++++++++++++++++++++++++++++---- 1 file changed, 48 insertions(+), 7 deletions(-) diff --git a/crates/ui-egui/src/i18n/tests.rs b/crates/ui-egui/src/i18n/tests.rs index 5cbbe4cf11..1add793f4e 100644 --- a/crates/ui-egui/src/i18n/tests.rs +++ b/crates/ui-egui/src/i18n/tests.rs @@ -4931,8 +4931,9 @@ fn unreadable(e: impl std::fmt::Display) -> String { } /// The scan reads the values of a local that a `.status(name)` shows, from the nearest `let` of -/// that name in the same function: a `format!` string and each arm of a `match`. It skips a local -/// that no status shows, a `let` of the name in another function, and a status given a value. +/// that name in the same function whose block is still open at the call: a `format!` string and +/// each arm of a `match`. It skips a local that no status shows, a `let` of the name in another +/// function or in a block that ended before the call, and a status given a value. #[test] fn message_scan_reads_locals_given_to_a_status() { let code = r#" @@ -4953,8 +4954,24 @@ fn saved(app: &mut App, saving: &str, e: &str, place: Option<&str>) { app.status(line); app.status(true); } + +fn scoped(app: &mut App) { + let note = "Outer message"; + { + let note = "Inner message"; + log(note); + } + app.status(note); +} + +fn braced(app: &mut App) { + let tip = "Kept open"; + log("}", '}', '\'', '\\'); + // } + app.status(tip); +} "#; - let want = ["{saving} failed: {e}", "Couldn't save to {folder}: {e}", "Couldn't save"]; + let want = ["{saving} failed: {e}", "Couldn't save to {folder}: {e}", "Couldn't save", "Outer message", "Kept open"]; assert_eq!(source_messages(code, &[], &std::collections::BTreeMap::new()), want); let ui = message_literals_in(&["ui-egui"]); for m in [ @@ -7230,9 +7247,12 @@ fn handler_returns<'a>(code: &'a str, name: &str) -> Vec<&'a str> { } /// Where each value of a local that a `.status(name)` in `code` shows can start: the statement of -/// the nearest `let name = ` before that call in the same function (`let line = format!("…");`, -/// `let line = match place { … };`, up to its `;`), read as [`closure_returns`] reads a closure. A -/// local that no `.status(name)` shows is not read. +/// the nearest `let name = ` before that call in the same function whose block is still open at +/// the call (`let line = format!("…");`, `let line = match place { … };`, up to its `;`), read as +/// [`closure_returns`] reads a closure. A `let` in a block that a `}` closes before the call is +/// skipped; a brace inside a string or character literal ([`quoted_end`]) does not open or close a +/// block. `code` comes from [`source_messages`] with its comments removed ([`without_comments`]), so +/// a brace in a comment is not seen. A local that no `.status(name)` shows is not read. fn status_locals(code: &str) -> Vec<&str> { let mut out = vec![]; for (at, m) in code.match_indices(".status(") { @@ -7242,7 +7262,28 @@ fn status_locals(code: &str) -> Vec<&str> { continue; } let bound = format!("let {name} = "); - let nearest = code[..at].rmatch_indices(bound.as_str()).find(|&(b, _)| !code[..b].ends_with(|c: char| c.is_alphanumeric() || c == '_')); + let open_at_call = |b: usize| { + let (mut depth, mut i) = (0usize, b); + while let Some(c) = code.get(i..at).and_then(|s| s.chars().next()) { + if let Some(end) = (c == '"' || c == '\'').then(|| quoted_end(code, i)).flatten() { + i = end; + continue; + } + match c { + '{' => depth += 1, + '}' => match depth.checked_sub(1) { + Some(d) => depth = d, + None => return false, + }, + _ => {} + } + i += c.len_utf8(); + } + true + }; + let nearest = code[..at] + .rmatch_indices(bound.as_str()) + .find(|&(b, _)| !code[..b].ends_with(|c: char| c.is_alphanumeric() || c == '_') && open_at_call(b)); if let Some((b, _)) = nearest && !code[b..at].contains("fn ") { From 3c0bdfbd43fde9400d0ea427934cad53f2145856 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Fri, 20 Nov 2026 20:48:18 -0800 Subject: [PATCH 5/5] i18n: the message scan reads character literals and fn inside strings The scan of status locals checked for a function boundary with a plain search for `fn `, so a local whose string held `fn ` was skipped. It now looks for `fn ` outside string and character literals. `statement`, `closure_returns`, `skip_args` and `without_strings` read the `"` of a character literal such as `'"'` as the start of a string, so a `match` arm on `'"'` hid the arms after it. They now skip character literals with `quoted_end`, which leaves a lifetime alone. --- crates/ui-egui/src/i18n/tests.rs | 81 ++++++++++++++++++++++++++++---- 1 file changed, 71 insertions(+), 10 deletions(-) diff --git a/crates/ui-egui/src/i18n/tests.rs b/crates/ui-egui/src/i18n/tests.rs index 1add793f4e..e82a573df6 100644 --- a/crates/ui-egui/src/i18n/tests.rs +++ b/crates/ui-egui/src/i18n/tests.rs @@ -4932,8 +4932,9 @@ fn unreadable(e: impl std::fmt::Display) -> String { /// The scan reads the values of a local that a `.status(name)` shows, from the nearest `let` of /// that name in the same function whose block is still open at the call: a `format!` string and -/// each arm of a `match`. It skips a local that no status shows, a `let` of the name in another -/// function or in a block that ended before the call, and a status given a value. +/// each arm of a `match`, a `'"'` arm included. It reads a local whose string holds `fn `. It +/// skips a local that no status shows, a `let` of the name in another function or in a block that +/// ended before the call, and a status given a value. #[test] fn message_scan_reads_locals_given_to_a_status() { let code = r#" @@ -4970,8 +4971,30 @@ fn braced(app: &mut App) { // } app.status(tip); } + +fn named(app: &mut App) { + let line = "Invalid fn declaration"; + app.status(line); +} + +fn quoted(app: &mut App, quote: char) { + let line = match quote { + '"' => "Double quote", + _ => "Other quote", + }; + app.status(line); +} "#; - let want = ["{saving} failed: {e}", "Couldn't save to {folder}: {e}", "Couldn't save", "Outer message", "Kept open"]; + let want = [ + "{saving} failed: {e}", + "Couldn't save to {folder}: {e}", + "Couldn't save", + "Outer message", + "Kept open", + "Invalid fn declaration", + "Double quote", + "Other quote", + ]; assert_eq!(source_messages(code, &[], &std::collections::BTreeMap::new()), want); let ui = message_literals_in(&["ui-egui"]); for m in [ @@ -7201,6 +7224,7 @@ fn skip_args(args: &str, n: usize) -> Option<&str> { match c { '(' | '[' | '{' => depth += 1, ')' | ']' | '}' => depth = depth.checked_sub(1)?, + '\'' => skip_char_literal(args, at, &mut chars), '"' => loop { match chars.next()?.1 { '\\' => { @@ -7285,7 +7309,7 @@ fn status_locals(code: &str) -> Vec<&str> { .rmatch_indices(bound.as_str()) .find(|&(b, _)| !code[..b].ends_with(|c: char| c.is_alphanumeric() || c == '_') && open_at_call(b)); if let Some((b, _)) = nearest - && !code[b..at].contains("fn ") + && !declares_fn(&code[b..at]) { out.extend(closure_returns(statement(&code[b + bound.len()..]))); } @@ -7293,7 +7317,35 @@ fn status_locals(code: &str) -> Vec<&str> { out } +/// Whether `code` holds the keyword `fn ` outside its string and character literals +/// ([`quoted_end`]). +fn declares_fn(code: &str) -> bool { + let mut i = 0; + while let Some(c) = code[i..].chars().next() { + if let Some(end) = (c == '"' || c == '\'').then(|| quoted_end(code, i)).flatten() { + i = end; + continue; + } + if code[i..].starts_with("fn ") && !code[..i].ends_with(|c: char| c.is_alphanumeric() || c == '_') { + return true; + } + i += c.len_utf8(); + } + false +} + +/// Moves `chars`, just past the `'` at `text[at]`, to the end of the character literal it opens +/// ([`quoted_end`]); a lifetime's `'` leaves it where it is. +fn skip_char_literal(text: &str, at: usize, chars: &mut std::str::CharIndices) { + if let Some(end) = quoted_end(text, at) { + for _ in text[at + 1..end].chars() { + chars.next(); + } + } +} + /// The statement `code` starts with, up to its `;` or the bracket that closes the block it is in. +/// A bracket, `;` or `"` inside a character literal (`'"'`) is skipped. fn statement(code: &str) -> &str { let (mut depth, mut chars) = (0usize, code.char_indices()); while let Some((at, c)) = chars.next() { @@ -7304,6 +7356,7 @@ fn statement(code: &str) -> &str { None => return &code[..at], }, ';' if depth == 0 => return &code[..at], + '\'' => skip_char_literal(code, at, &mut chars), '"' => loop { match chars.next() { Some((_, '\\')) => { @@ -7328,7 +7381,8 @@ fn statement(code: &str) -> &str { /// only when the local's name is used, outside a string literal and a `format!`, in a value the closure returns /// (`let why = if … { format!("…") } else { … }; Error(why)`), and not when the local only goes /// elsewhere (`let level = if … { "warning" } else { "error" }; log(level);`). A `return` counts -/// wherever it is, except inside a closure the body holds (`unwrap_or_else(|| return …)`). +/// wherever it is, except inside a closure the body holds (`unwrap_or_else(|| return …)`). A +/// character literal (`'"'`, `'{'`) is skipped, so it does not open a string or a block. fn closure_returns(body: &str) -> Vec<&str> { let ident = |c: char| c.is_alphanumeric() || c == '_'; // The name a `let` statement starting at `at` binds (empty for a pattern), if it is one. @@ -7387,6 +7441,7 @@ fn closure_returns(body: &str) -> Vec<&str> { { found.push((&body[at + "return".len()..], None, true)); } + '\'' => skip_char_literal(body, at, &mut chars), '"' => loop { match chars.next() { Some((_, '\\')) => { @@ -7441,14 +7496,20 @@ fn without_format_args(code: &str) -> String { out } -/// `code` with the text of its string literals removed, the quotes kept. +/// `code` with the text of its string literals removed, the quotes kept. A character literal +/// (`'"'`) stays as it is. fn without_strings(code: &str) -> String { - let (mut out, mut chars) = (String::new(), code.chars()); - while let Some(c) = chars.next() { + let (mut out, mut chars) = (String::new(), code.char_indices()); + while let Some((at, c)) = chars.next() { out.push(c); - if c == '"' { + if c == '\'' + && let Some(end) = quoted_end(code, at) + { + out.push_str(&code[at + 1..end]); + skip_char_literal(code, at, &mut chars); + } else if c == '"' { loop { - match chars.next() { + match chars.next().map(|(_, c)| c) { Some('\\') => { chars.next(); }