mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-12-02 20:18:38 -05:00
Tests: ui-egui tests outside the panels check counts and waits
- Artboard frame tests assert how many frames are drawn before checking each one, so a canvas that draws no frames fails them. - Find Font's refresh test checks the document's one family and the one row it shows instead of checking every row of a list that may be empty. - The freeform paint chip test also checks an opaque point and the chip's size, and the holographic test checks the foil chip's size. - The background wait tests (Quit, packaging and export made at once) open the writer's gate when the UI thread starts waiting, through a test-only hook in background::wait_until, instead of after a sleep. Each asserts that the wait happened. - Cancel Open waits for the file to be read before Cancel instead of sleeping after it. - The automation roots test checks that the open keeps the same roots. - The brightness test reads the saved ids and old labels in place of a round trip through its own table. - Removed every_tool_cursors_hotspot_lies_inside_its_icon_box, which every_tool_cursors_hotspot_is_on_its_glyph covers, and message_dump_lists_the_reported_messages and the schema phrase loop, which held by construction. - dump_source_strings is ignored with a reason; the translator commands in docs/development.md pass --ignored.
This commit is contained in:
1 parent
5970647dec
commit
38debaa67e
13 files changed
+89
-85
No files matched your search
@@ -331,10 +331,21 @@ pub fn wait_all(app: &mut VectorcraftApp) {
|
||||
wait_until(app, |_| false);
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
thread_local! {
|
||||
/// Run once on this thread when [`wait_until`] next starts to wait for a job's result, so a test
|
||||
/// lets a held job finish only once the wait has started.
|
||||
pub(crate) static ON_WAIT: std::cell::RefCell<Option<Box<dyn FnOnce()>>> = const { std::cell::RefCell::new(None) };
|
||||
}
|
||||
|
||||
/// Apply the jobs' results as they arrive (in the order the jobs were started) until `ready` holds
|
||||
/// or no job is left.
|
||||
pub fn wait_until(app: &mut VectorcraftApp, ready: impl Fn(&VectorcraftApp) -> bool) {
|
||||
while !ready(app) && !app.background.jobs.is_empty() {
|
||||
#[cfg(test)]
|
||||
if let Some(waiting) = ON_WAIT.with_borrow_mut(Option::take) {
|
||||
waiting();
|
||||
}
|
||||
let Some(done) = app.background.results.as_ref().and_then(|(_, rx)| rx.recv().ok()) else {
|
||||
// No result can arrive: the jobs can't finish.
|
||||
for job in std::mem::take(&mut app.background.jobs) {
|
||||
|
||||
@@ -29,9 +29,11 @@ fn the_artboard_tool_names_its_active_artboard_once() {
|
||||
assert!(names.iter().enumerate().all(|(i, n)| n.as_deref().is_some_and(|n| n.starts_with(&format!("{:02} - ", i + 1)))));
|
||||
let mut single = app_with(1);
|
||||
use_tool(&mut single, "selection");
|
||||
assert!(frames_of(&single, false).iter().all(|f| f.name.is_none()));
|
||||
let unnamed = frames_of(&single, false);
|
||||
assert!(unnamed.len() == 1 && unnamed[0].name.is_none(), "{:?}", unnamed.len());
|
||||
use_tool(&mut single, "artboard");
|
||||
assert!(frames_of(&single, false).iter().all(|f| f.name.is_some()));
|
||||
let named = frames_of(&single, false);
|
||||
assert!(named.len() == 1 && named[0].name.is_some(), "{:?}", named.len());
|
||||
use_tool(&mut app, "artboard");
|
||||
assert_eq!(frames_of(&app, false).iter().filter(|f| f.name.is_some()).count(), 2);
|
||||
}
|
||||
@@ -53,10 +55,14 @@ fn outline_has_white_artboards_on_a_white_canvas_with_line_edges() {
|
||||
let st = app.session.active().unwrap();
|
||||
assert_eq!(pasteboard_color(&app, st, true), PasteboardColor::Custom(DataColor::new(Color32::WHITE)));
|
||||
assert_eq!(border(true), PageBorder::Line);
|
||||
assert!(frames_of(&app, true).iter().all(|f| f.fill == Some(PageFill::Color(DataColor::new(Color32::WHITE)))));
|
||||
let outline = frames_of(&app, true);
|
||||
assert_eq!(outline.len(), 2, "a frame for each artboard");
|
||||
assert!(outline.iter().all(|f| f.fill == Some(PageFill::Color(DataColor::new(Color32::WHITE)))));
|
||||
assert_eq!(pasteboard_color(&app, st, false), PasteboardColor::Default);
|
||||
assert_eq!(border(false), PageBorder::DropShadow);
|
||||
assert!(frames_of(&app, false).iter().all(|f| f.fill.is_some()));
|
||||
let preview = frames_of(&app, false);
|
||||
assert_eq!(preview.len(), 2, "a frame for each artboard");
|
||||
assert!(preview.iter().all(|f| f.fill.is_some()));
|
||||
}
|
||||
|
||||
/// Overprint Preview, and Separations Preview, which turns it on, draw a white canvas around the artboards and no
|
||||
@@ -83,7 +89,9 @@ fn overprint_preview_draws_a_white_canvas_without_shadows() {
|
||||
assert_eq!(border(false), PageBorder::DropShadow, "{at}");
|
||||
}
|
||||
assert_eq!(border(true), PageBorder::Line, "{at}");
|
||||
assert!(frames_of(&app, false).iter().all(|f| f.fill.is_some()), "{at}");
|
||||
let frames = frames_of(&app, false);
|
||||
assert_eq!(frames.len(), 2, "{at}: a frame for each artboard");
|
||||
assert!(frames.iter().all(|f| f.fill.is_some()), "{at}");
|
||||
}
|
||||
}
|
||||
app.run("view.overprintPreview", json!({"on": true})).unwrap();
|
||||
@@ -182,7 +190,9 @@ fn paper_is_the_artboard_color_times_the_simulated_paper() {
|
||||
assert_eq!(artboard_paper(&ab, Color32::WHITE), Color32::from_rgb(51, 102, 153));
|
||||
// The frame carries the same fill.
|
||||
app.run("view.transparencyGrid", json!({})).unwrap();
|
||||
assert!(frames_of(&app, false).iter().all(|f| matches!(f.fill, Some(PageFill::Checker(_)))));
|
||||
let frames = frames_of(&app, false);
|
||||
assert_eq!(frames.len(), 1, "the artboard's frame");
|
||||
assert!(frames.iter().all(|f| matches!(f.fill, Some(PageFill::Checker(_)))));
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -205,7 +215,9 @@ fn the_transparency_grid_follows_each_document_and_the_view_menu_label() {
|
||||
assert_eq!(menus::dynamic_label(&app, "view.transparencyGrid", ""), "Show Transparency Grid");
|
||||
assert_eq!(app.run("view.transparencyGrid", json!({})).unwrap(), json!({"on": true}));
|
||||
assert!(shows_transparency_grid(app.session.active().unwrap()));
|
||||
assert!(frames_of(&app, false).iter().all(|f| matches!(f.fill, Some(PageFill::Checker(_)))));
|
||||
let frames = frames_of(&app, false);
|
||||
assert_eq!(frames.len(), 1, "the artboard's frame");
|
||||
assert!(frames.iter().all(|f| matches!(f.fill, Some(PageFill::Checker(_)))));
|
||||
assert_eq!(menus::dynamic_label(&app, "view.transparencyGrid", ""), "Hide Transparency Grid");
|
||||
app.run("document.activate", json!({"index": 0})).unwrap();
|
||||
assert!(!shows_transparency_grid(app.session.active().unwrap()));
|
||||
|
||||
@@ -1,15 +1,5 @@
|
||||
use super::*;
|
||||
|
||||
/// A hotspot is data a typo moves off the glyph: every painted tool cursor's lies in its icon's box.
|
||||
#[test]
|
||||
fn every_tool_cursors_hotspot_lies_inside_its_icon_box() {
|
||||
for c in GLYPHS {
|
||||
if let cb::Cursor::Painted(PaintedCursor::Tool { hotspot, .. }) = tool_cursor(c) {
|
||||
assert!((0.0..=24.0).contains(&hotspot.x) && (0.0..=24.0).contains(&hotspot.y), "{c:?}: {hotspot:?}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// A click lands where the glyph points: in every painted tool cursor's image, the icon's own
|
||||
/// mark color (not only its halo) covers the hotspot pixel or one next to it.
|
||||
#[test]
|
||||
|
||||
@@ -345,13 +345,9 @@ fn a_dirty_documents_save_is_written_before_its_package() {
|
||||
app.session.execute("prefs.set", &json!({"values": {"backgroundExport": false}})).unwrap();
|
||||
app.run("shape.rectangle", json!({"x": 0, "y": 0, "width": 10, "height": 10})).unwrap();
|
||||
package_dialog(&mut app, &out);
|
||||
let opener = gate.clone();
|
||||
let release = std::thread::spawn(move || {
|
||||
std::thread::sleep(std::time::Duration::from_millis(50));
|
||||
opener.open();
|
||||
});
|
||||
let waited = gate.open_on_wait();
|
||||
reply(&mut app).unwrap();
|
||||
release.join().unwrap();
|
||||
assert!(waited.get(), "the package waited for the save");
|
||||
assert_eq!(written(&files), [doc]);
|
||||
assert!(app.background.jobs.is_empty() && !app.session.active().unwrap().is_dirty());
|
||||
assert!(app.ui.status.starts_with("Packaged 3 files in "), "the package's status came last: {}", app.ui.status);
|
||||
@@ -451,14 +447,10 @@ fn a_package_made_at_once_waits_for_one_in_the_background() {
|
||||
// the background.
|
||||
app.session.execute("prefs.set", &json!({"values": {"backgroundExport": false}})).unwrap();
|
||||
package_dialog(&mut app, &out);
|
||||
let opener = gate.clone();
|
||||
let release = std::thread::spawn(move || {
|
||||
std::thread::sleep(std::time::Duration::from_millis(500));
|
||||
opener.open();
|
||||
});
|
||||
let waited = gate.open_on_wait();
|
||||
reply(&mut app).unwrap();
|
||||
assert!(waited.get(), "the package made at once waited for the one in the background");
|
||||
assert!(app.background.jobs.is_empty(), "the package in the background was written first");
|
||||
release.join().unwrap();
|
||||
assert_eq!(written(&files).len(), 3);
|
||||
assert!(std::path::Path::new(&out).join("card Folder/card.vectorcraft").is_file());
|
||||
}
|
||||
|
||||
@@ -653,14 +653,10 @@ fn an_export_made_at_once_waits_for_one_in_the_background() {
|
||||
let p = json!({"folder": folder, "formats": [{"format": "svg"}]});
|
||||
assert_eq!(app.run("file.exportForScreens", p.clone()).unwrap()["background"], true);
|
||||
background_export(&mut app, false);
|
||||
let opener = gate.clone();
|
||||
let release = std::thread::spawn(move || {
|
||||
std::thread::sleep(std::time::Duration::from_millis(500));
|
||||
opener.open();
|
||||
});
|
||||
let waited = gate.open_on_wait();
|
||||
let r = app.run("file.exportForScreens", p).unwrap();
|
||||
assert!(waited.get(), "the export made at once waited for the one in the background");
|
||||
assert!(app.background.jobs.is_empty(), "the export in the background was written first");
|
||||
release.join().unwrap();
|
||||
let file = format!("{folder}/Artboard-1.svg");
|
||||
assert_eq!((written(&files), r["files"].clone()), (vec![file.clone()], json!([file])));
|
||||
assert_eq!(app.ui.status, format!("Exported 1 file to {folder}"));
|
||||
|
||||
@@ -1208,11 +1208,12 @@ mod tests {
|
||||
d.pending = Some(Action::ChangeAll);
|
||||
});
|
||||
pump_now(&mut app);
|
||||
assert!(fonts(&mut app).iter().all(|f| f["family"] == "Source Serif 4"), "the document changed");
|
||||
let d = opened(&app);
|
||||
let now = fonts(&mut app);
|
||||
let families: Vec<&Value> = now.iter().map(|f| &f["family"]).collect();
|
||||
assert_eq!(families, [&json!("Source Serif 4")], "the document changed");
|
||||
let d = opened(&app);
|
||||
assert_eq!(d.rows, replacement_rows(&app, "document", &now), "the rows follow the document");
|
||||
assert!(d.rows.iter().all(|r| r.family == "Source Serif 4"), "{:?}", d.rows);
|
||||
assert_eq!(d.rows.iter().map(|r| r.family.as_str()).collect::<Vec<_>>(), ["Source Serif 4"], "{:?}", d.rows);
|
||||
assert!(d.pending.is_none(), "the press was taken");
|
||||
}
|
||||
|
||||
|
||||
@@ -798,11 +798,12 @@ fn literal_spans(code: &str) -> Vec<(usize, usize)> {
|
||||
out
|
||||
}
|
||||
|
||||
/// For translators, `cargo test -p vectorcraft-ui-egui dump_source_strings` writes every English
|
||||
/// interface string to `VECTORCRAFT_I18N_DUMP=<file>`, and every status and error message as a
|
||||
/// For translators, `cargo test -p vectorcraft-ui-egui dump_source_strings -- --ignored` writes every
|
||||
/// English interface string to `VECTORCRAFT_I18N_DUMP=<file>`, and every status and error message as a
|
||||
/// catalog template that [`untranslated_report`] checks to `VECTORCRAFT_I18N_DUMP_MESSAGES=<file>`,
|
||||
/// one per line.
|
||||
#[test]
|
||||
#[ignore = "translator tool: writes the files VECTORCRAFT_I18N_DUMP and VECTORCRAFT_I18N_DUMP_MESSAGES name"]
|
||||
fn dump_source_strings() {
|
||||
if let Ok(path) = std::env::var("VECTORCRAFT_I18N_DUMP") {
|
||||
let mut all = crate::menus::menu_strings();
|
||||
@@ -813,27 +814,11 @@ fn dump_source_strings() {
|
||||
std::fs::write(path, text).expect("write dump");
|
||||
}
|
||||
if let Ok(path) = std::env::var("VECTORCRAFT_I18N_DUMP_MESSAGES") {
|
||||
std::fs::write(path, message_dump()).expect("write dump");
|
||||
let text: String = reported_messages().iter().map(|m| format!("{m}\n")).collect();
|
||||
std::fs::write(path, text).expect("write dump");
|
||||
}
|
||||
}
|
||||
|
||||
/// The text [`dump_source_strings`] writes to `VECTORCRAFT_I18N_DUMP_MESSAGES`.
|
||||
fn message_dump() -> String {
|
||||
reported_messages().iter().map(|m| format!("{m}\n")).collect()
|
||||
}
|
||||
|
||||
/// The translators' message dump lists every message the untranslated report checks, the
|
||||
/// phrases a parameter schema's error builds included.
|
||||
#[test]
|
||||
fn message_dump_lists_the_reported_messages() {
|
||||
let dump = message_dump();
|
||||
let lines: std::collections::BTreeSet<&str> = dump.lines().collect();
|
||||
for phrase in SCHEMA_PHRASES {
|
||||
assert!(lines.contains(phrase), "the dump skips {phrase:?}");
|
||||
}
|
||||
assert!(lines.contains("the color book is cut short"));
|
||||
}
|
||||
|
||||
/// Languages whose catalogs leave [`MENU_KEEP_AS_IS`] in English.
|
||||
const KEEPS_MENU_NAMES: [&str; 20] =
|
||||
["cs", "de", "el", "es", "fr", "hi", "hu", "it", "ja", "ka", "ko", "pl", "pt-br", "ru", "sv", "uk", "vi", "fi", "tr", "ca"];
|
||||
@@ -1199,9 +1184,9 @@ fn reported_messages() -> std::collections::BTreeSet<String> {
|
||||
}
|
||||
|
||||
/// The untranslated report checks the messages of the effects and of the crates whose errors the
|
||||
/// engine and the effects pass on, and the phrases a parameter schema's error builds.
|
||||
/// engine and the effects pass on.
|
||||
#[test]
|
||||
fn untranslated_report_checks_every_message_crate_and_schema_phrase() {
|
||||
fn untranslated_report_checks_every_message_crate() {
|
||||
let reported = reported_messages();
|
||||
let passed_on = [
|
||||
("effects", "the SVG filter has no primitives"),
|
||||
@@ -1214,9 +1199,6 @@ fn untranslated_report_checks_every_message_crate_and_schema_phrase() {
|
||||
assert!(message_literals_in(&[krate]).contains(m), "{krate}: {m}");
|
||||
assert!(reported.contains(m), "the report skips {krate}: {m}");
|
||||
}
|
||||
for phrase in SCHEMA_PHRASES {
|
||||
assert!(reported.contains(*phrase), "the report skips the schema phrase {phrase:?}");
|
||||
}
|
||||
}
|
||||
|
||||
/// Banner Hems and Grommets' errors and the status of a recovery copy that failed without a folder
|
||||
|
||||
@@ -439,7 +439,9 @@ fn a_file_opened_under_automation_roots_finishes_under_them() {
|
||||
start(&mut app, "/art/Scoped.vectorcraft", vectorcraft_format::save(&vectorcraft_doc::Document::new(10.0, 10.0), false))
|
||||
});
|
||||
let scope = app.opening.pending[0].scope.clone();
|
||||
assert!(scope.run(file_access::current).is_some(), "the roots go with the open");
|
||||
assert!(file_access::current().is_none(), "the desktop has no roots here");
|
||||
let (given, kept) = (roots.expect("roots for the folder"), scope.run(file_access::current).expect("the roots go with the open"));
|
||||
assert!(std::sync::Arc::ptr_eq(&given, &kept), "the open keeps the roots it started under");
|
||||
}
|
||||
|
||||
/// A file asked for again while it is still being read is not read a second time (#3455).
|
||||
@@ -600,10 +602,11 @@ fn cancelling_an_open_opens_nothing() {
|
||||
let before = app.session.documents().len();
|
||||
start(&mut app, "/art/Big.vectorcraft", bytes("Big"));
|
||||
assert!(crate::menus::enabled(&app, "file.cancelOpen"));
|
||||
// The file has been read and its result waits for the next frame when Cancel is pressed.
|
||||
wait_read(&mut app);
|
||||
assert_eq!(app.run("file.cancelOpen", json!({})).unwrap()["cancelled"], 1);
|
||||
assert!(app.opening.pending.is_empty() && !long_operation_busy(&app));
|
||||
assert!(!app.ui.status.starts_with("Opening"), "{}", app.ui.status);
|
||||
std::thread::sleep(std::time::Duration::from_millis(50));
|
||||
poll(&mut app);
|
||||
assert_eq!(app.session.documents().len(), before);
|
||||
assert_ne!(app.ui.recent_files.first().map(String::as_str), Some("/art/Big.vectorcraft"));
|
||||
|
||||
@@ -300,11 +300,16 @@ mod tests {
|
||||
fn freeform_chip_shows_the_points_opacity() {
|
||||
use vectorcraft_color::{Freeform, FreeformPoint};
|
||||
use vectorcraft_geom::kurbo::Point;
|
||||
let mut gp = paint(GradientKind::Freeform, 0.0);
|
||||
let clear = FreeformPoint { opacity: 0.0, ..FreeformPoint::new(Point::new(10.0, 10.0), Color::BLACK) };
|
||||
gp.freeform = Some(Freeform { points: vec![clear], ..Default::default() });
|
||||
let chip = gradient_chip_colors(&gp, 20.0, 20.0, 4, 4);
|
||||
assert!(chip.iter().all(|c| c.a() == 0), "{chip:?}");
|
||||
let chip = |opacity: f32| {
|
||||
let mut gp = paint(GradientKind::Freeform, 0.0);
|
||||
let point = FreeformPoint { opacity, ..FreeformPoint::new(Point::new(10.0, 10.0), Color::BLACK) };
|
||||
gp.freeform = Some(Freeform { points: vec![point], ..Default::default() });
|
||||
gradient_chip_colors(&gp, 20.0, 20.0, 4, 4)
|
||||
};
|
||||
let (clear, opaque) = (chip(0.0), chip(1.0));
|
||||
assert_eq!((clear.len(), opaque.len()), (25, 25), "a color at each corner of the 4 by 4 cells");
|
||||
assert!(clear.iter().all(|c| c.a() == 0), "{clear:?}");
|
||||
assert!(opaque.iter().all(|c| *c == Color32::BLACK), "{opaque:?}");
|
||||
}
|
||||
|
||||
/// A Holographic glow's chip is clear at the corners and nearly opaque at the center; a foil's
|
||||
@@ -320,6 +325,7 @@ mod tests {
|
||||
assert!([0, 4, 20, 24].iter().all(|&i| glow[i].a() == 0), "{glow:?}");
|
||||
assert!(glow[2 * 5 + 2].a() >= 240, "{glow:?}");
|
||||
let foil = chip("Prism Veil");
|
||||
assert_eq!(foil.len(), glow.len(), "the same 5 by 5 corners");
|
||||
assert!(foil.iter().all(|c| c.a() == 255), "{foil:?}");
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,18 @@ impl Gate {
|
||||
std::thread::sleep(std::time::Duration::from_millis(1));
|
||||
}
|
||||
}
|
||||
|
||||
/// Open the gate once this thread starts to wait for a background job ([`background::wait_until`]).
|
||||
/// The flag returned says whether it did.
|
||||
pub(crate) fn open_on_wait(&self) -> std::rc::Rc<std::cell::Cell<bool>> {
|
||||
let (gate, opened) = (self.clone(), std::rc::Rc::new(std::cell::Cell::new(false)));
|
||||
let flag = opened.clone();
|
||||
background::ON_WAIT.set(Some(Box::new(move || {
|
||||
flag.set(true);
|
||||
gate.open();
|
||||
})));
|
||||
opened
|
||||
}
|
||||
}
|
||||
|
||||
/// Gives `app` a window host over `jobs`, as the window installs it, so its background work runs
|
||||
@@ -347,14 +359,10 @@ fn quitting_waits_for_background_saves() {
|
||||
let (mut app, files) = app(gate.clone());
|
||||
app.run("file.new", json!({"width": 100, "height": 100})).unwrap();
|
||||
app.run("file.save", json!({"path": "/docs/q.vectorcraft"})).unwrap();
|
||||
let opener = gate.clone();
|
||||
let release = std::thread::spawn(move || {
|
||||
std::thread::sleep(std::time::Duration::from_millis(50));
|
||||
opener.open();
|
||||
});
|
||||
let waited = gate.open_on_wait();
|
||||
// Without waiting, the document would still count as modified and Quit would ask about it.
|
||||
let r: Value = app.run("app.quit", json!({})).unwrap();
|
||||
release.join().unwrap();
|
||||
assert!(waited.get(), "Quit waited for the save");
|
||||
assert!(r.is_null(), "{r}");
|
||||
assert_eq!(app.ui.status, "quit");
|
||||
assert_eq!(written(&files), ["/docs/q.vectorcraft"]);
|
||||
|
||||
@@ -218,13 +218,16 @@ pub fn mono(size: f32) -> FontId {
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
/// The saved strings are what Preferences and old settings files hold.
|
||||
/// Preferences saves a brightness by its id, and old settings files hold its label, in any
|
||||
/// case; any other text is not a brightness.
|
||||
#[test]
|
||||
fn brightness_roundtrip() {
|
||||
for b in Brightness::ALL {
|
||||
assert_eq!(Brightness::parse(b.id()), Some(b));
|
||||
assert_eq!(Brightness::parse(b.label()), Some(b));
|
||||
}
|
||||
fn brightness_reads_saved_ids_and_old_labels() {
|
||||
assert_eq!(Brightness::MediumDark.id(), "mediumDark", "the id Preferences saves");
|
||||
assert_eq!(Brightness::parse("mediumDark"), Some(Brightness::MediumDark));
|
||||
assert_eq!(Brightness::parse("Medium Light"), Some(Brightness::MediumLight));
|
||||
assert_eq!(Brightness::parse("LIGHT"), Some(Brightness::Light));
|
||||
assert_eq!(Brightness::parse("medium"), None);
|
||||
assert_eq!(Brightness::parse(""), None);
|
||||
}
|
||||
|
||||
/// A size `app_sizes` cannot read is only logged and dropped, which brings the pill buttons back unnoticed.
|
||||
|
||||
+2
-2
@@ -294,7 +294,7 @@ other `sv-*` locale resolve to it), Georgian (`ka`, complete; `ka-GE` and `ka_GE
|
||||
placeholders and ellipses agree, command ids exist, every row of a partial catalog is a string the UI
|
||||
shows, the UI fonts have every glyph, no Simplified characters in `zh-hant`) pick it up. Set `complete_menus`
|
||||
once the menus and `tl!` literals are translated; the untranslated report then lists what the catalog lacks
|
||||
(`VECTORCRAFT_I18N_DUMP=strings.txt cargo test -p vectorcraft-ui-egui dump_source_strings` lists every
|
||||
(`VECTORCRAFT_I18N_DUMP=strings.txt cargo test -p vectorcraft-ui-egui dump_source_strings -- --ignored` lists every
|
||||
English string).
|
||||
- A missing translation never fails a test or a build: the interface shows the English text until a translator
|
||||
adds the row. `cargo xtask i18n-report` prints, per language, the strings its catalog lacks (menu strings,
|
||||
@@ -329,7 +329,7 @@ other `sv-*` locale resolve to it), Georgian (`ka`, complete; `ka-GE` and `ka_GE
|
||||
`bad(…)` or `failed(…)`, and the messages a `.map_err(|e| …)` closure returns (from each `if` branch,
|
||||
`match` arm and statement of a block) or the handler a `.map_err(name)` names returns (a closure bound with `let name = |e| …;` or a
|
||||
function `fn name(…)`), and skips calls inside comments
|
||||
(`VECTORCRAFT_I18N_DUMP_MESSAGES=messages.txt cargo test -p vectorcraft-ui-egui dump_source_strings` lists them
|
||||
(`VECTORCRAFT_I18N_DUMP_MESSAGES=messages.txt cargo test -p vectorcraft-ui-egui dump_source_strings -- --ignored` lists them
|
||||
all). A missing row shows the English message. Other languages show messages in English until they add `@msg`
|
||||
rows.
|
||||
- Not translated on purpose: names that are user data (layers, swatches, fonts, documents), the tab
|
||||
|
||||
@@ -1360,7 +1360,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
|
||||
- In that Liquify warning, the tool's name and each kind of object it left (graphs, type, symbols, images, meshes, envelopes, repeats, placed documents, blends) are shown in the interface language too, in the order the command lists them and joined as the language joins a list, in each catalog that translates all status and error messages (`liquify-tool`, `liquify-kind` and `liquify-list-*` rows); a kind that Liquify does not list leaves the tool and the list in English (`liquify_warning_translates_its_tool_and_kinds_in_every_complete_catalog`).
|
||||
- An effect a plug-in's output or an importer plug-in's objects carry that VectorCraft refuses (``[0] `id`: reason``) shows in the status bar with its reason in the interface language inside `plug-in output: …` and `can't open …`, in every catalog that translates all status and error messages; the index and the effect id stay as they are, and a JSON array in a message stays as it is (`nested_effect_refusals_translate_with_their_reason`, `bracketed_message_parts_translate_only_as_exact_messages`).
|
||||
- A filter run (`plugin.run`) or plug-in command whose output changes no object and none of the data the plug-in keeps with the document records no undo step and leaves a saved document unmodified, with its objects still selected; a run that may call commands records none when its calls leave the document as it was (engine `plugins::a_filter_run_that_changes_nothing_records_no_undo_step`, `plugins::a_filter_that_keeps_the_same_data_records_no_undo_step`, `plugins::a_plugin_command_that_changes_nothing_records_no_undo_step`).
|
||||
- The untranslated report lists the status and error messages of the effects, swatch libraries, raster sizes and encoders, 3D solids and path operations that a catalog lacks, the messages that a `.map_err` closure or a named error handler returns, and the phrases a parameter schema's error builds for what a value must be (`untranslated_report_checks_every_message_crate_and_schema_phrase`, `message_scan_reads_map_err_closures`, `message_scan_reads_named_map_err_handlers`).
|
||||
- The untranslated report lists the status and error messages of the effects, swatch libraries, raster sizes and encoders, 3D solids and path operations that a catalog lacks, the messages that a `.map_err` closure or a named error handler returns, and the phrases a parameter schema's error builds for what a value must be (`untranslated_report_checks_every_message_crate`, `message_scan_reads_map_err_closures`, `message_scan_reads_named_map_err_handlers`).
|
||||
- The Swedish catalog has rows for the Apply SVG Filter and Check Spelling command names, the SVG Filter effect's name, which also names its undo step, and the 3D and Materials panel's note that graphics map onto the Plane, Extrude and Revolve object types, so these show in Swedish instead of English (`swedish_svg_filter_spelling_and_3d_labels_are_complete`).
|
||||
- Spanish messages (2026-11-13): the Spanish catalog (`crates/ui-egui/src/i18n/es.tsv`) has an `@msg` row for 114 of the 167 status and error messages that the untranslated report (`untranslated_report`) lists as missing in all 23 complete-message languages: the errors of the image encoders, color profiles, swatch exchange files and color books, 3D and Revolve, path operations, DXF import, the script engine and the parameter checks. Open #7211 and #7378 translate 51 of the others (the composite font and SVG filter errors), and 2 stay in English. The rows keep the placeholders, backticked names, accepted values and limits of their English (`spanish_translates_encoder_profile_swatch_revolve_and_parameter_errors`); native review remains; scores and estimates unchanged.
|
||||
- Export commands run through MCP, the control channel or the CLI refuse a key that no format takes, and warn about a key that only another format takes (`{"format": "pdf", "quality": 80}` writes the PDF with the warning "`quality` was not used: PDF files don't read it"; `an_option_only_another_format_reads_gets_a_note`, `control_export_notes_an_option_the_format_does_not_read`, `convert_warns_about_an_unused_option_only_when_one_was_given`), and a command that writes one format (`document.exportPdf`, `document.exportEps`, `document.exportDxf`) or takes one format's options (`document.pdfSettings`, `pdf.preset.save`) refuses a key that format doesn't take. An unknown key inside `marks`, `bleed`, `compression`, `output`, `advanced`, `security` or `flattener` is refused by its path.
|
||||
|
||||
Reference in new issue
Block a user