diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index a27edb4049..10c8459a62 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -5774,6 +5774,7 @@ digits Malayalam Malaiàlam @msg bad trailer tràiler incorrecte @msg balance must be between 0 and 100 balance ha d’estar entre 0 i 100 @msg batch step {_1} (`{id}`) failed: {e} el pas de lot {_1} (`{id}`) ha fallat: {e} +@msg action step {_1} (`{id}`) failed: {reason} el pas {_1} de l’acció (`{id}`) ha fallat: {reason} @msg Batch: {count} processed Lot: {count} processats @msg Batch: {count} processed, {failed} failed Lot: {count} processats, {failed} fallits @msg before must name a panel before ha de nomenar un panell diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 2abd6d89c2..f53eedbb24 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -5281,6 +5281,7 @@ liquify-list-end {0}, {1} {0} a {1} @msg bad trailer chybný trailer @msg balance must be between 0 and 100 balance musí být mezi 0 a 100 @msg batch step {_1} (`{id}`) failed: {e} krok dávky {_1} (`{id}`) selhal: {e} +@msg action step {_1} (`{id}`) failed: {reason} krok akce {_1} (`{id}`) selhal: {reason} @msg brightness must be dark|mediumDark|mediumLight|light brightness musí být dark|mediumDark|mediumLight|light @msg can't encode the document: {0} dokument nelze zakódovat: {0} @msg can't parse shortcut `{c}` klávesovou zkratku `{c}` nelze analyzovat diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index 8b36a58fcf..b8d2a32a1f 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -7482,6 +7482,7 @@ imageTrace Outline Kontur @msg bad trailer ugyldig trailer @msg balance must be between 0 and 100 balance skal være mellem 0 og 100 @msg batch step {_1} (`{id}`) failed: {e} batchtrin {_1} (`{id}`) mislykkedes: {e} +@msg action step {_1} (`{id}`) failed: {reason} handlingstrin {_1} (`{id}`) mislykkedes: {reason} @msg brightness must be dark|mediumDark|mediumLight|light brightness skal være dark|mediumDark|mediumLight|light @msg can't encode the document: {0} kan ikke kode dokumentet: {0} @msg can't parse shortcut `{c}` kan ikke parse genvejen `{c}` diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index 5afa48e8a5..ae12182c03 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -4881,6 +4881,7 @@ liquify-list-end {0}, {1} {0} und {1} @msg bad trailer fehlerhafter Trailer @msg balance must be between 0 and 100 balance muss zwischen 0 und 100 liegen @msg batch step {_1} (`{id}`) failed: {e} Stapelschritt {_1} (`{id}`) ist fehlgeschlagen: {e} +@msg action step {_1} (`{id}`) failed: {reason} Aktionsschritt {_1} (`{id}`) ist fehlgeschlagen: {reason} @msg brightness must be dark|mediumDark|mediumLight|light brightness muss dark|mediumDark|mediumLight|light sein @msg can't encode the document: {0} das Dokument kann nicht kodiert werden: {0} @msg can't parse shortcut `{c}` Tastaturbefehl `{c}` kann nicht ausgewertet werden diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index 884c725122..98068f764a 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -4935,6 +4935,7 @@ digits Malayalam Μαλαγιάλαμ @msg bad trailer μη έγκυρο τελικό τμήμα @msg balance must be between 0 and 100 το balance πρέπει να είναι μεταξύ 0 και 100 @msg batch step {_1} (`{id}`) failed: {e} απέτυχε το βήμα {_1} της μαζικής επεξεργασίας (`{id}`): {e} +@msg action step {_1} (`{id}`) failed: {reason} απέτυχε το βήμα {_1} της ενέργειας (`{id}`): {reason} @msg brightness must be dark|mediumDark|mediumLight|light το brightness πρέπει να είναι dark|mediumDark|mediumLight|light @msg can't encode the document: {0} δεν είναι δυνατή η κωδικοποίηση εγγράφου: {0} @msg can't parse shortcut `{c}` δεν είναι δυνατή η ανάλυση της συντόμευσης `{c}` diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index b7504a39a4..d7f8f454a8 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -4985,6 +4985,7 @@ liquify-list-end {0}, {1} {0}, {1} @msg bad trailer trailer no válido @msg balance must be between 0 and 100 balance debe estar entre 0 y 100 @msg batch step {_1} (`{id}`) failed: {e} falló el paso {_1} del lote (`{id}`): {e} +@msg action step {_1} (`{id}`) failed: {reason} falló el paso {_1} de la acción (`{id}`): {reason} @msg brightness must be dark|mediumDark|mediumLight|light brightness debe ser dark|mediumDark|mediumLight|light @msg can't encode the document: {0} no se puede codificar el documento: {0} @msg can't parse shortcut `{c}` no se puede interpretar el atajo `{c}` diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index 485ff4f68c..959cd29d59 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -5206,6 +5206,7 @@ liquify-list-end {0}, {1} {0} ja {1} @msg bad trailer virheellinen trailer @msg balance must be between 0 and 100 balance-arvon on oltava väliltä 0–100 @msg batch step {_1} (`{id}`) failed: {e} erävaihe {_1} (`{id}`) epäonnistui: {e} +@msg action step {_1} (`{id}`) failed: {reason} toiminnon vaihe {_1} (`{id}`) epäonnistui: {reason} @msg brightness must be dark|mediumDark|mediumLight|light brightness-arvon on oltava dark|mediumDark|mediumLight|light @msg can't encode the document: {0} asiakirjaa ei voi koodata: {0} @msg can't parse shortcut `{c}` pikanäppäintä `{c}` ei voi jäsentää diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 43d4d9ff04..5fc5c77c3a 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -4947,6 +4947,7 @@ liquify-list-end {0}, {1} {0} et {1} @msg bad trailer trailer non valide @msg balance must be between 0 and 100 balance doit être compris entre 0 et 100 @msg batch step {_1} (`{id}`) failed: {e} l’étape {_1} du lot (`{id}`) a échoué : {e} +@msg action step {_1} (`{id}`) failed: {reason} l’étape {_1} du script (`{id}`) a échoué : {reason} @msg brightness must be dark|mediumDark|mediumLight|light brightness doit valoir dark|mediumDark|mediumLight|light @msg can't encode the document: {0} impossible d’encoder le document : {0} @msg can't parse shortcut `{c}` impossible d’interpréter le raccourci `{c}` diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index 67548f1325..28af0c95cd 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -6845,6 +6845,7 @@ antiAlias Sharp शार्प @msg bad trailer size बुरा ट्रेलर आकार @msg balance must be between 0 and 100 balance 0 से 100 के बीच होना चाहिए @msg batch step {_1} (`{id}`) failed: {e} बैच चरण {_1} (`{id}`) विफल: {e} +@msg action step {_1} (`{id}`) failed: {reason} कार्रवाई चरण {_1} (`{id}`) विफल: {reason} @msg Batch: {count} processed बैच: {count} संसाधित @msg Batch: {count} processed, {failed} failed बैच: {count} संसाधित, {failed} विफल @msg batches cannot nest बैच घोंसला नहीं कर सकते diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index 47caf89db9..bef7aec335 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -5379,6 +5379,7 @@ imageTrace Outline Körvonal @msg bad trailer hibás záró rész (trailer) @msg balance must be between 0 and 100 a balance értéke 0 és 100 között lehet @msg batch step {_1} (`{id}`) failed: {e} a kötegelt lépés sikertelen: {_1} (`{id}`): {e} +@msg action step {_1} (`{id}`) failed: {reason} a művelet lépése sikertelen: {_1} (`{id}`): {reason} @msg before must name a panel a before egy panelt kell megnevezzen @msg below and above must name a panel floating in another group a below és az above egy másik csoportban lebegő panelt kell megnevezzen @msg Blend colors: select at least three objects with filled colours Színek összemosása: jelölj ki legalább három kitöltött objektumot diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 33ce8cd044..cb5f9e7269 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -5015,6 +5015,7 @@ liquify-list-end {0}, {1} {0} e {1} @msg bad trailer trailer non valido @msg balance must be between 0 and 100 balance deve essere compreso tra 0 e 100 @msg batch step {_1} (`{id}`) failed: {e} il passaggio {_1} del batch (`{id}`) non è riuscito: {e} +@msg action step {_1} (`{id}`) failed: {reason} il passaggio {_1} dell’azione (`{id}`) non è riuscito: {reason} @msg brightness must be dark|mediumDark|mediumLight|light brightness deve essere dark|mediumDark|mediumLight|light @msg can't encode the document: {0} impossibile codificare il documento: {0} @msg can't parse shortcut `{c}` impossibile interpretare la scelta rapida `{c}` diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index d31b4dc2b1..fb1f71bb33 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -4796,6 +4796,7 @@ swatch Bright Violet ビビッドバイオレット @msg Expand: no gradient fills 拡張: グラデーションの塗りがありません @msg Expand: nothing to expand 拡張: 拡張するものがありません @msg batch step {_1} (`{id}`) failed: {e} バッチのステップ {_1} (`{id}`) が失敗しました: {e} +@msg action step {_1} (`{id}`) failed: {reason} アクションのステップ {_1} (`{id}`) が失敗しました: {reason} @msg BMP files are RGB or grayscale: colorModel rgb or gray BMP ファイルが対応するのは RGB とグレースケールのみです: colorModel には rgb または gray を指定してください @msg Targa files are RGB: colorModel rgb Targa ファイルが対応するのは RGB のみです: colorModel には rgb を指定してください @msg antiAlias `{id}`: none, art or type antiAlias に `{id}` は指定できません: none、art、type のいずれかを指定してください diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index faa9f4ca23..432c575577 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -4723,6 +4723,7 @@ theme Appearance 외관 @msg Expand: no gradient fills 확장: 그레이디언트 칠이 없습니다 @msg Expand: nothing to expand 확장: 확장할 항목이 없습니다 @msg batch step {_1} (`{id}`) failed: {e} 일괄 처리 단계 {_1}(`{id}`) 실패: {e} +@msg action step {_1} (`{id}`) failed: {reason} 액션 단계 {_1}(`{id}`) 실패: {reason} @msg BMP files are RGB or grayscale: colorModel rgb or gray BMP 파일은 RGB 또는 그레이스케일입니다: colorModel rgb 또는 gray @msg Targa files are RGB: colorModel rgb Targa 파일은 RGB입니다: colorModel rgb @msg antiAlias `{id}`: none, art or type antiAlias `{id}`: none, art 또는 type이어야 합니다 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index 9a845739d3..1eb7e2e8d4 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -5354,6 +5354,7 @@ imageTrace Outline Contour @msg bad trailer onjuiste trailer @msg balance must be between 0 and 100 balance moet tussen 0 en 100 liggen @msg batch step {_1} (`{id}`) failed: {e} batchstap {_1} (`{id}`) is mislukt: {e} +@msg action step {_1} (`{id}`) failed: {reason} actiestap {_1} (`{id}`) is mislukt: {reason} @msg brightness must be dark|mediumDark|mediumLight|light brightness moet dark|mediumDark|mediumLight|light zijn @msg can't encode the document: {0} kan het document niet coderen: {0} @msg can't parse shortcut `{c}` kan sneltoets `{c}` niet parseren diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index b3e575e95c..1c5c5d0b0b 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -5104,6 +5104,7 @@ liquify-list-end {0}, {1} {0} i {1} @msg bad trailer nieprawidłowa sekcja trailer @msg balance must be between 0 and 100 balance musi mieścić się w zakresie od 0 do 100 @msg batch step {_1} (`{id}`) failed: {e} krok wsadowy {_1} (`{id}`) nie powiódł się: {e} +@msg action step {_1} (`{id}`) failed: {reason} krok operacji {_1} (`{id}`) nie powiódł się: {reason} @msg brightness must be dark|mediumDark|mediumLight|light brightness musi mieć wartość dark|mediumDark|mediumLight|light @msg can't encode the document: {0} nie można zakodować dokumentu: {0} @msg can't parse shortcut `{c}` nie można przeanalizować skrótu `{c}` diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 4997457349..d08ac9380d 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -4286,6 +4286,7 @@ axis Both Ambos @msg bad trailer trailer inválido @msg balance must be between 0 and 100 balance deve estar entre 0 e 100 @msg batch step {_1} (`{id}`) failed: {e} a etapa {_1} do lote (`{id}`) falhou: {e} +@msg action step {_1} (`{id}`) failed: {reason} a etapa {_1} da ação (`{id}`) falhou: {reason} @msg brightness must be dark|mediumDark|mediumLight|light brightness deve ser dark|mediumDark|mediumLight|light @msg can't encode the document: {0} não foi possível codificar o documento: {0} @msg can't parse shortcut `{c}` não foi possível interpretar o atalho `{c}` diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index 7f23bfac2c..289943277b 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -5009,6 +5009,7 @@ liquify-list-end {0}, {1} {0} и {1} @msg bad trailer недопустимый трейлер @msg balance must be between 0 and 100 balance должен быть от 0 до 100 @msg batch step {_1} (`{id}`) failed: {e} шаг пакета {_1} (`{id}`) не выполнен: {e} +@msg action step {_1} (`{id}`) failed: {reason} шаг действия {_1} (`{id}`) не выполнен: {reason} @msg brightness must be dark|mediumDark|mediumLight|light brightness должен быть dark|mediumDark|mediumLight|light @msg can't encode the document: {0} не удалось закодировать документ: {0} @msg can't parse shortcut `{c}` не удалось разобрать сочетание `{c}` diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index cb9ec49a3b..11d6cbbfb7 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -4881,6 +4881,7 @@ liquify-list-end {0}, {1} {0} och {1} @msg bad trailer ogiltig trailer @msg balance must be between 0 and 100 balance måste vara mellan 0 och 100 @msg batch step {_1} (`{id}`) failed: {e} batchsteg {_1} (`{id}`) misslyckades: {e} +@msg action step {_1} (`{id}`) failed: {reason} åtgärdssteg {_1} (`{id}`) misslyckades: {reason} @msg brightness must be dark|mediumDark|mediumLight|light brightness måste vara dark|mediumDark|mediumLight|light @msg can't encode the document: {0} kan inte koda dokumentet: {0} @msg can't parse shortcut `{c}` kan inte tolka kortkommandot `{c}` diff --git a/crates/ui-egui/src/i18n/tests.rs b/crates/ui-egui/src/i18n/tests.rs index b115b44cde..7bca7695d2 100644 --- a/crates/ui-egui/src/i18n/tests.rs +++ b/crates/ui-egui/src/i18n/tests.rs @@ -4026,6 +4026,23 @@ fn selected_path_reason_is_translated() { } } +/// The error of a played action step is translated in every language of [`COMPLETE_MESSAGES`], with +/// its reason; the step's number and command id stay as they are. +#[test] +fn action_step_errors_are_translated() { + let template = "action step {_1} (`{id}`) failed: {reason}"; + assert!(message_literals().contains(template)); + let reason = "select a path"; + let error = format!("action step 4 (`path.reverse`) failed: {reason}"); + assert_eq!(message(Lang::EN, &error), error); + for code in COMPLETE_MESSAGES { + let lang = Lang::from_code(code).expect("registered"); + let shown = message(lang, &error); + assert!(!shown.starts_with("action step") && shown.contains('4') && shown.contains("`path.reverse`"), "{code}: {shown}"); + assert!(shown.contains(&message(lang, reason)) && !shown.contains(reason), "{code}: {shown}"); + } +} + /// The refusals of a linked JavaScript file or a library's file outside the read roots, of a file /// name that fits more than one linked JavaScript file, and of an appearance edit of the art a /// graph design draws in a graph series have translated rows in languages that translate every diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index 072b2b1dae..2c93ced641 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -4695,6 +4695,7 @@ liquify-list-end {0}, {1} {0} ve {1} @msg bad trailer kötü römork @msg balance must be between 0 and 100 balance 0 ile 100 arasında olmalıdır @msg batch step {_1} (`{id}`) failed: {e} toplu adım {_1} (`{id}`) başarısız oldu: {e} +@msg action step {_1} (`{id}`) failed: {reason} eylem adımı {_1} (`{id}`) başarısız oldu: {reason} @msg brightness must be dark|mediumDark|mediumLight|light brightness dark|mediumDark|mediumLight|light olmalıdır @msg can't encode the document: {0} belge kodlanamıyor: {0} @msg can't parse shortcut `{c}` `{c}` kısayolu ayrıştırılamıyor diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index 2e9fbfcfb1..70d22ab587 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -4999,6 +4999,7 @@ liquify-list-end {0}, {1} {0} і {1} @msg bad trailer неприпустимий трейлер @msg balance must be between 0 and 100 balance має бути від 0 до 100 @msg batch step {_1} (`{id}`) failed: {e} крок пакету {_1} (`{id}`) не виконано: {e} +@msg action step {_1} (`{id}`) failed: {reason} крок дії {_1} (`{id}`) не виконано: {reason} @msg brightness must be dark|mediumDark|mediumLight|light brightness має бути dark|mediumDark|mediumLight|light @msg can't encode the document: {0} не вдалося закодувати документ: {0} @msg can't parse shortcut `{c}` не вдалося розібрати поєднання `{c}` diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index 0e2f3e91f1..e14a3f1c49 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -5037,6 +5037,7 @@ theme Appearance Giao diện @msg bad trailer trailer không hợp lệ @msg balance must be between 0 and 100 balance phải nằm trong khoảng 0 đến 100 @msg batch step {_1} (`{id}`) failed: {e} bước hàng loạt {_1} (`{id}`) thất bại: {e} +@msg action step {_1} (`{id}`) failed: {reason} bước {_1} của hành động (`{id}`) thất bại: {reason} @msg before must name a panel before phải đặt tên bảng @msg below and above must name a panel floating in another group below và above phải đặt tên bảng đang thả nổi trong nhóm khác @msg Blend colors: select at least three objects with filled colours Hòa trộn màu: chọn ít nhất ba đối tượng có màu tô diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index 5b372ecf37..a9ecf4ac45 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -4497,6 +4497,7 @@ imageTrace Outline 轮廓 @msg Expand: no gradient fills 扩展:没有渐变填色 @msg Expand: nothing to expand 扩展:没有可扩展的内容 @msg batch step {_1} (`{id}`) failed: {e} 批处理步骤 {_1} (`{id}`) 失败:{e} +@msg action step {_1} (`{id}`) failed: {reason} 动作步骤 {_1} (`{id}`) 失败:{reason} @msg BMP files are RGB or grayscale: colorModel rgb or gray BMP 文件为 RGB 或灰度:colorModel rgb 或 gray @msg Targa files are RGB: colorModel rgb Targa 文件为 RGB:colorModel rgb @msg antiAlias `{id}`: none, art or type antiAlias `{id}`:none、art 或 type diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index e29cadec18..8db053188d 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -2001,6 +2001,7 @@ file-filter Templates 範本 @msg Expand: no gradient fills 展開:沒有漸層填色 @msg Expand: nothing to expand 展開:沒有可展開的內容 @msg batch step {_1} (`{id}`) failed: {e} 批次步驟 {_1} (`{id}`) 失敗:{e} +@msg action step {_1} (`{id}`) failed: {reason} 動作步驟 {_1} (`{id}`) 失敗:{reason} @msg BMP files are RGB or grayscale: colorModel rgb or gray BMP 檔案為 RGB 或灰階:colorModel rgb 或 gray @msg Targa files are RGB: colorModel rgb Targa 檔案為 RGB:colorModel rgb @msg antiAlias `{id}`: none, art or type antiAlias `{id}`:none、art 或 type diff --git a/crates/ui-egui/src/panels/actions.rs b/crates/ui-egui/src/panels/actions.rs index ccf7665359..c979d46fd5 100644 --- a/crates/ui-egui/src/panels/actions.rs +++ b/crates/ui-egui/src/panels/actions.rs @@ -75,13 +75,19 @@ impl Action { /// played, or a panel operation that runs as one batch, while recording) gives its own steps, /// since batches do not nest. pub(crate) fn included_commands(&self) -> Vec { + self.playback_steps().into_iter().map(|s| s.command).collect() + } + + /// [`Action::included_commands`], each with the index in [`Action::steps`] of the step it comes + /// from: the steps of a recorded `command.batch` share its index. + fn playback_steps(&self) -> Vec { self.steps .iter() .enumerate() .filter(|(i, _)| !self.excluded_steps.contains(i)) - .flat_map(|(_, (command, params))| match params.get("commands").and_then(Value::as_array) { - Some(steps) if command == "command.batch" => steps.clone(), - _ => vec![json!({"command": command, "params": params})], + .flat_map(|(row, (command, params))| match params.get("commands").and_then(Value::as_array) { + Some(steps) if command == "command.batch" => steps.iter().map(|c| PlayStep { row, command: c.clone() }).collect(), + _ => vec![PlayStep { row, command: json!({"command": command, "params": params}) }], }) .collect() } @@ -151,6 +157,14 @@ pub(crate) fn shown_text(text: &str) -> String { shown } +/// A step that playback runs: a command as `command.batch` takes it, and the index in +/// [`Action::steps`] of the step it comes from, which an error names. +#[derive(Clone, Debug)] +struct PlayStep { + row: usize, + command: Value, +} + /// An action id no other action in this run has. fn next_action_id() -> u64 { static NEXT: std::sync::atomic::AtomicU64 = std::sync::atomic::AtomicU64::new(1); @@ -333,9 +347,12 @@ pub fn default_sets() -> Vec { /// A View menu step ([`is_ui_step`]) runs on its own at every speed, in its place among the steps, and /// adds no undo step ([`run_steps`]). At Accelerated the steps before it and the steps after it are /// then one undo step each. +/// +/// At every speed, the error of a step that fails names the step by its place in the action, 1 for +/// the first, counting excluded steps and stops ([`step_error`]). pub fn play(app: &mut VectorcraftApp, set: usize, idx: usize) -> Result { let Some(a) = app.ui.action_sets.get(set).and_then(|s| s.actions.get(idx)).cloned() else { return Err("no such action".into()) }; - let commands = a.included_commands(); + let commands = a.playback_steps(); if commands.is_empty() { return Err("the action has no included steps".into()); } @@ -350,13 +367,13 @@ pub fn play(app: &mut VectorcraftApp, set: usize, idx: usize) -> Result = commands.into(); + let mut steps: std::collections::VecDeque = commands.into(); let Some(first) = steps.pop_front() else { return Err("the action has no included steps".into()) }; let result = play_step(app, &a.name, first)?; let pending = steps.len(); @@ -374,7 +391,7 @@ pub fn play(app: &mut VectorcraftApp, set: usize, idx: usize) -> Result Result { +fn play_step(app: &mut VectorcraftApp, label: &str, step: PlayStep) -> Result { Ok(run_steps(app, label, vec![step])?.into_iter().next().unwrap_or(Value::Null)) } @@ -387,20 +404,33 @@ pub(crate) fn is_ui_step(step: &Value) -> bool { /// Runs `steps` in order, as saved steps ([`VectorcraftApp::replay`]) → their results. The steps /// between two View menu steps ([`is_ui_step`]) run as one `command.batch` named `label`, which is one /// undo step; a View menu step runs on its own ([`play_ui_step`]). A step that fails ends the run with -/// its error: the batch it is in changes nothing, and the steps before that batch stay done. -fn run_steps(app: &mut VectorcraftApp, label: &str, steps: Vec) -> Result, String> { - fn batch(app: &mut VectorcraftApp, label: &str, run: Vec, results: &mut Vec) -> Result<(), String> { +/// its error: the batch it is in changes nothing, and the steps before that batch stay done. The error +/// of a step names the step's place in the action ([`step_error`]). +fn run_steps(app: &mut VectorcraftApp, label: &str, steps: Vec) -> Result, String> { + fn batch(app: &mut VectorcraftApp, label: &str, run: Vec, results: &mut Vec) -> Result<(), String> { if run.is_empty() { return Ok(()); } - let r = app.replay("command.batch", json!({"label": label, "commands": run}))?; + let (rows, run): (Vec, Vec) = run.into_iter().map(|s| (s.row, s.command)).unzip(); + let r = match app.replay("command.batch", json!({"label": label, "commands": run})) { + Ok(r) => r, + Err(e) => { + // The batch numbers its steps from 0 within this run of them, not within the action. + if let Some((n, id, reason)) = batch_step_failure(&e) + && let Some(&row) = rows.get(n) + { + return step_error(row, id, reason); + } + return Err(e); + } + }; results.extend(r.get("results").and_then(Value::as_array).cloned().unwrap_or_default()); Ok(()) } let mut results = Vec::with_capacity(steps.len()); let mut run = vec![]; for step in steps { - if is_ui_step(&step) { + if is_ui_step(&step.command) { batch(app, label, std::mem::take(&mut run), &mut results)?; results.push(play_ui_step(app, &step)?); } else { @@ -411,13 +441,34 @@ fn run_steps(app: &mut VectorcraftApp, label: &str, steps: Vec) -> Result Ok(results) } +/// The step number, command id and reason in the error `command.batch` gives when one of its steps +/// fails (``batch step 2 (`object.move`) failed: …``); none for any other error, such as one about +/// the whole batch. +fn batch_step_failure(e: &str) -> Option<(usize, &str, &str)> { + let rest = e.strip_prefix("batch step ")?; + let digits = rest.find(|c: char| !c.is_ascii_digit())?; + let n = rest[..digits].parse().ok()?; + let (id, reason) = rest[digits..].strip_prefix(" (`")?.split_once("`) failed: ")?; + Some((n, id, reason)) +} + +/// The error of a played step with command `id` that failed with `reason`, naming the step by its +/// place in the action: 1 for the action's first step, counting excluded steps and stops. A step of +/// a recorded `command.batch` is named by the batch's place and its own command. +fn step_error(row: usize, id: &str, reason: &str) -> Result { + Err(format!("action step {} (`{id}`) failed: {reason}", row + 1)) +} + /// Runs a View menu step as its menu item runs it, which adds no undo step → its result. While an /// action records, the step goes into the recording too, as a stop does, unless it does not fit in /// the action ([`recording_room`]): then the status bar shows the reason. -fn play_ui_step(app: &mut VectorcraftApp, step: &Value) -> Result { - let command = step.get("command").and_then(Value::as_str).unwrap_or_default().to_string(); - let params = step.get("params").filter(|p| !p.is_null()).cloned().unwrap_or_else(|| json!({})); - let r = app.replay(&command, params.clone())?; +fn play_ui_step(app: &mut VectorcraftApp, step: &PlayStep) -> Result { + let command = step.command.get("command").and_then(Value::as_str).unwrap_or_default().to_string(); + let params = step.command.get("params").filter(|p| !p.is_null()).cloned().unwrap_or_else(|| json!({})); + let r = match app.replay(&command, params.clone()) { + Ok(r) => r, + Err(e) => return step_error(step.row, &command, &e), + }; if app.ui.recording.is_some() { match recording_room(app, &command, ¶ms) { Ok(()) => app.session.journal.push((command, params)), @@ -429,8 +480,8 @@ fn play_ui_step(app: &mut VectorcraftApp, step: &Value) -> Result /// [`play`] for an action with a stop: runs what comes before the first stop, or at Step by Step and /// Pause For the first step, and leaves the rest to [`tick_playback`] and [`continue_playback`]. -fn play_with_stops(app: &mut VectorcraftApp, label: String, commands: Vec, options: PlaybackOptions) -> Result { - let mut steps: std::collections::VecDeque = commands.into(); +fn play_with_stops(app: &mut VectorcraftApp, label: String, commands: Vec, options: PlaybackOptions) -> Result { + let mut steps: std::collections::VecDeque = commands.into(); let run = next_run(&mut steps, options.speed); let ran = !run.is_empty(); let results = if ran { run_steps(app, &label, run)? } else { vec![] }; @@ -441,9 +492,9 @@ fn play_with_stops(app: &mut VectorcraftApp, label: String, commands: Vec /// Takes the steps that run next as one undo step off the front of `steps`: at Accelerated all of /// them up to the next stop, at the other speeds one. None when a stop comes next. -fn next_run(steps: &mut std::collections::VecDeque, speed: PlaybackSpeed) -> Vec { +fn next_run(steps: &mut std::collections::VecDeque, speed: PlaybackSpeed) -> Vec { let mut run = vec![]; - while steps.front().is_some_and(|s| !is_stop(s)) { + while steps.front().is_some_and(|s| !is_stop(&s.command)) { run.extend(steps.pop_front()); if speed != PlaybackSpeed::Accelerated { break; @@ -462,7 +513,7 @@ fn after_run(app: &mut VectorcraftApp, ran: bool) { playing.played_in = played_in; playing.next_at = None; playing.hold = ran && playing.options.speed == PlaybackSpeed::Step; - if (!ran || playing.options.speed == PlaybackSpeed::Accelerated) && playing.steps.front().is_some_and(is_stop) { + if (!ran || playing.options.speed == PlaybackSpeed::Accelerated) && playing.steps.front().is_some_and(|s| is_stop(&s.command)) { hold_at_stop(app); } if let Some(ctx) = &app.ui_ctx { @@ -527,7 +578,7 @@ struct AtStop { fn hold_at_stop(app: &mut VectorcraftApp) { let Some(playing) = app.ui.action_playing.as_mut() else { return }; let Some(step) = playing.steps.pop_front() else { return }; - let params = step.get("params").cloned().unwrap_or(Value::Null); + let params = step.command.get("params").cloned().unwrap_or(Value::Null); let message = params.get("message").and_then(Value::as_str).unwrap_or_default().to_string(); let allow_continue = params.get("allowContinue").and_then(Value::as_bool).unwrap_or(false); playing.stop = Some(AtStop { message, allow_continue, shown: false }); @@ -632,7 +683,7 @@ pub fn deserialize_playback<'de, D: serde::Deserializer<'de>>(d: D) -> Result, + steps: std::collections::VecDeque, /// The options the action started playing with. options: PlaybackOptions, /// With Pause For, when the next step runs (seconds on the app's clock); none until the frame @@ -690,7 +741,7 @@ pub fn tick_playback(app: &mut VectorcraftApp, now: f64) -> Option { return Some(due - now); } } - if playing.steps.front().is_some_and(is_stop) { + if playing.steps.front().is_some_and(|s| is_stop(&s.command)) { hold_at_stop(app); return None; } @@ -5993,6 +6044,105 @@ mod tests { assert_eq!(x(&app), 1.0, "the move before Outline stays, and the move of 2 in the failing batch is taken back"); } + /// The error of a played step that fails, with the step's place in the action (1 for the first) + /// and its command id. + fn assert_names_step(e: &str, step: usize, id: &str) { + let prefix = format!("action step {step} (`{id}`) failed: "); + assert!(e.starts_with(&prefix) && e.len() > prefix.len(), "{e}"); + assert!(!e.contains("batch step"), "{e}"); + } + + /// A step that fails after a View menu step at Accelerated is named by its place in the action, + /// not by its place in the batch of the steps after the View step. + #[test] + fn an_error_after_a_view_item_names_the_step_in_the_action() { + let (mut app, _) = app_with_a_view_step(); + app.ui.action_sets[0].actions[0].steps.insert(3, ("object.align".into(), json!({}))); + assert_names_step(&play(&mut app, 0, 0).unwrap_err(), 4, "object.align"); + } + + /// A View menu step that fails is named by its place in the action, excluded steps counted. + #[test] + fn a_failing_view_item_names_the_step_in_the_action() { + let mut app = VectorcraftApp::new(Session::new(), Default::default()); + let steps = vec![("object.move".to_string(), json!({"dx": 1, "dy": 0})), ("view.outline".to_string(), json!({}))]; + let mut action = Action::new("Outline", steps); + action.excluded_steps.insert(0); + app.ui.action_sets = vec![ActionSet::new("Test", vec![action])]; + assert_names_step(&play(&mut app, 0, 0).unwrap_err(), 2, "view.outline"); + } + + /// An excluded step before the failing one counts at Accelerated, as the panel lists it. + #[test] + fn an_error_counts_excluded_steps() { + let (mut app, x) = app_with_three_moves(); + let action = &mut app.ui.action_sets[0].actions[0]; + action.steps.push(("object.align".into(), json!({}))); + action.excluded_steps.insert(0); + assert_names_step(&play(&mut app, 0, 0).unwrap_err(), 4, "object.align"); + assert_eq!(x(&app), 0.0, "the failing batch changes nothing"); + } + + /// A step of a recorded `command.batch` that fails is named by the batch's place in the action + /// and its own command. + #[test] + fn an_error_in_a_recorded_batch_names_the_batch_step() { + let (mut app, _) = app_with_three_moves(); + let batch = json!({"commands": [{"command": "object.move", "params": {"dx": 2, "dy": 0}}, {"command": "object.align", "params": {}}]}); + app.ui.action_sets[0].actions[0].steps.insert(1, ("command.batch".into(), batch)); + assert_names_step(&play(&mut app, 0, 0).unwrap_err(), 2, "object.align"); + } + + /// An error about the whole batch, which names no step, is kept as it is. + #[test] + fn an_error_of_the_whole_batch_names_no_step() { + let (mut app, _) = app_with_three_moves(); + let nested = json!({"commands": [{"command": "command.batch", "params": {"commands": []}}]}); + app.ui.action_sets[0].actions[0].steps.push(("command.batch".into(), nested)); + let e = play(&mut app, 0, 0).unwrap_err(); + assert!(!e.starts_with("action step"), "{e}"); + assert!(e.contains("batches cannot nest"), "{e}"); + } + + /// At Step by Step and Pause For, a later step that fails is named by its place in the action, + /// in the status bar, and the playback ends. + #[test] + fn a_paced_error_names_the_step_in_the_action() { + for speed in ["step", "pause"] { + let (mut app, x) = app_with_three_moves(); + app.ui.action_sets[0].actions[0].steps.insert(2, ("object.align".into(), json!({}))); + app.run(PLAYBACK_OPTIONS, json!({"speed": speed})).unwrap(); + play(&mut app, 0, 0).unwrap(); + let mut now = 0.0; + for _ in 0..40 { + if app.ui.action_playing.is_none() { + break; + } + now += 2.0; + frame(&mut app, now); + } + assert!(app.ui.action_playing.is_none(), "{speed}: the playback ended"); + assert_names_step(&app.ui.status, 3, "object.align"); + assert_eq!(x(&app), 3.0, "{speed}: the moves before the failing step stay, the move after it does not run"); + } + } + + /// A step that fails after Continue at a stop is named by its place in the action, the stops + /// before it counted, the excluded one too. + #[test] + fn an_error_after_a_stop_names_the_step_in_the_action() { + let (mut app, _) = app_with_three_moves(); + let stop = (STOP_STEP.to_string(), json!({"message": "", "allowContinue": true})); + let action = &mut app.ui.action_sets[0].actions[0]; + action.steps.insert(1, stop.clone()); + action.steps.insert(3, stop); + action.steps.push(("object.align".into(), json!({}))); + action.excluded_steps.insert(3); + assert_eq!(play(&mut app, 0, 0).unwrap()["atStop"], json!(true)); + assert_names_step(&app.run(CONTINUE_PLAYBACK, json!({})).unwrap_err(), 6, "object.align"); + assert!(app.ui.action_playing.is_none(), "the playback ended"); + } + /// At Step by Step and Pause For a View menu step is one step of the playback and adds no undo /// step. #[test] diff --git a/docs/mcp.md b/docs/mcp.md index 79d70488b2..236013c0ca 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -3959,8 +3959,11 @@ already walks Image Trace. Short agent entry points: menu step (`ui.action.insertMenuItem`) plays at every speed in its place among the steps, as its menu item runs, and adds no undo step. At Accelerated the steps before it and the steps after it are one undoable batch each, and the result is `{results}` with every step's result in order. A step that fails ends the playback with its error: the - batch it is in changes nothing, and the steps before that batch stay done. While another action records, the View - menu step is recorded too. Batch… refuses an action with an included View menu step. + batch it is in changes nothing, and the steps before that batch stay done. At every speed, and after + `ui.action.continue`, the error names the step by its place in the action, 1 for the first step, counting excluded + steps and stops (``action step 4 (`object.align`) failed: …``). A failing step of a recorded `command.batch` is + named by the batch's place and its own command. An error about the whole batch names no step. While another action + records, the View menu step is recorded too. Batch… refuses an action with an included View menu step. - Actions: `ui.action.playAt {set, action}` plays the action at `action` in set `set` (0 is the top set) as `ui.action.play` plays it and returns what `ui.action.play` returns. A click on an action's button in Button Mode runs this. A missing index, or one that is not a whole number or is past the last set or action, is an error, and diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 079936a8a2..dd38d5fb45 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -877,6 +877,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - Actions panel: the panel menu's Insert Stop… opens Record Stop, with a Message box and Allow Continue, and adds a stop to the recording in progress, after the selected command, or at the end of the selected action ([Insert stops in actions](https://helpx.adobe.com/illustrator/desktop/automate-visualize-data/automate-actions/insert-stops-in-actions.html); `ui.action.insertStop`). A playing action waits at the stop and shows the message so the user can do a manual task, and Play Current Selection plays the rest ([Illustrator CS5 help](https://help.adobe.com/archive/en_US/illustrator/cs5/illustrator_cs5_help.pdf#page=459); `ui.action.continue`). With Allow Continue, the message box also has Continue. VectorCraft's own rules, which the pages do not cover: an empty message still waits, Stop Playing/Recording ends the playback and keeps the steps already played, the rest plays on the document active then, a stop waits at every playback speed, at Accelerated the steps between two stops are one undo step, Batch… refuses an action with an included stop, and Delete Selection on a selected step deletes that step, a stop or a command, without asking (`ui.action.deleteStep`). - Actions panel: the panel menu's Insert Menu Item… adds a menu command to the recording in progress, after the selected step, or at the end of the selected action, without running it, and playback runs it as the menu does ([Insert non-recordable tasks into actions](https://helpx.adobe.com/illustrator/desktop/automate-visualize-data/automate-actions/insert-non-recordable-tasks-into-actions.html); `ui.action.insertMenuItem`). The dialog's Find box picks the one item that matches the words typed, and a click on a listed item picks it. VectorCraft's own rules, which the page does not cover: items that open a dialog, Image Trace's Make and Make and Expand, Pattern's Make and Edit Pattern, and the File, Window and Help menu items are not listed, and an action holds at most 10,000 steps and its set file at most 8 MiB, for stops too. - Actions panel: Insert Menu Item… also lists the Object › Align items and the View menu commands that act on the window rather than the document (Outline, Pixel Preview, Trim View, Presentation Mode, Screen Mode, zoom, fit, Rotate View, and the show, hide and snap items), which the help page names among the commands that cannot be recorded ([Insert non-recordable tasks into actions](https://helpx.adobe.com/illustrator/desktop/automate-visualize-data/automate-actions/insert-non-recordable-tasks-into-actions.html); [Align and distribute objects](https://helpx.adobe.com/illustrator/desktop/manage-objects/arrange-objects/align-and-distribute-objects.html); `ui.action.insertMenuItem`, `ui.action.play`). VectorCraft's own rules, which the pages do not cover: an Align step keeps the Align To choice of its insertion, and one that aligns to the key object stops the playback when there is no key; a View menu step plays in its place at every speed and adds no undo step, so at Accelerated the steps on each side of it are one undo step each; Batch… refuses an action with one; and a set file with one is version 6. Tests `panels::actions::tests::{an_inserted_view_item_plays_in_its_place_at_accelerated, an_inserted_view_item_plays_step_by_step_and_with_pauses, an_inserted_view_item_plays_up_to_a_stop, a_view_step_played_while_recording_is_recorded, a_saved_view_step_survives_as_version_6, an_inserted_align_item_keeps_the_align_to_of_its_insertion, an_align_step_to_the_key_object_fails_without_a_key}`. + - Actions panel: the error of a played step that fails names the step by its place in the expanded action, 1 for the first step, counting excluded steps and stops, at every playback speed and after a stop (`ui.action.play`, `ui.action.continue`). A failing step of a recorded batch is named by the batch's place and its own command. The numbering is VectorCraft's own rule. Tests `panels::actions::tests::{an_error_after_a_view_item_names_the_step_in_the_action, a_failing_view_item_names_the_step_in_the_action, an_error_counts_excluded_steps, an_error_in_a_recorded_batch_names_the_batch_step, an_error_of_the_whole_batch_names_no_step, a_paced_error_names_the_step_in_the_action, an_error_after_a_stop_names_the_step_in_the_action}`. - Actions panel: with a path selected, the panel menu's Insert Select Path adds a step that selects that path to the recording in progress, after the selected step, or at the end of the selected action, without changing the selection ([Insert non-recordable tasks into actions](https://helpx.adobe.com/illustrator/desktop/automate-visualize-data/automate-actions/insert-non-recordable-tasks-into-actions.html); `ui.action.insertSelectPath`, `select.storedPath`). VectorCraft's own rules, which the page does not cover: the selection must be one whole path or compound path that can be selected, the step stores the path's id and a fingerprint of its anchors, and playback selects the path only while it is still there unchanged and can be selected, else the step is an error and the selection stays; the row reads Select Path, and a set file with the step is version 5. - Actions panel: the panel menu's Select Object… opens Set Selection, where the note typed names the objects to select, and adds a step to the recording in progress, after the selected step, or at the end of the selected action; playback selects the objects whose Attributes note matches it, and the steps after it act on them ([Insert non-recordable tasks into actions](https://helpx.adobe.com/illustrator/desktop/automate-visualize-data/automate-actions/insert-non-recordable-tasks-into-actions.html); `ui.action.insertSelectObject`, `select.byNote`). VectorCraft's own rules, which the page does not cover: the note matches anywhere and in any letter case unless Case Sensitive or Whole Word is checked, hidden and locked objects are left out, the objects found replace the selection, a step that finds none stops the playback with an error, and the note is at most 1,024 bytes. Action sets with the step save as version 4. - Actions panel: Delete Selection deletes the selected action set with its actions and keeps the other sets ([Actions panel overview](https://helpx.adobe.com/illustrator/desktop/automate-visualize-data/automate-actions/actions-panel-overview.html); `ui.actionSet.delete`). VectorCraft's own rules, which the overview does not cover: deleting a set asks first, Shift-click on a set's name selects a range of sets to delete together, the panel menu's Delete does the same, and Default Actions and the last set can be deleted. Undo does not bring a deleted set back.