From 0854e12332785c2795124880e807653157cf3a0b Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 14 Nov 2026 02:28:54 -0800 Subject: [PATCH] i18n: Georgian translates the messages no catalog had a row for The untranslated report listed 55 messages that none of the 23 message-checked catalogs translate. Open pull requests add Georgian rows for 53 of them; ka.tsv now has rows for the other two: document.activate's "`index` must be a whole number" and PDF export's warning about knockout groups with too many translucent elements. The report read the knockout warning wrongly. Its literal ends a line with `\`, which Rust drops along with the line break and the next line's leading whitespace, but the scanner kept both, so no catalog row could match the text the program shows. The scanner now joins such a literal as Rust does, with LF and CRLF line endings (message_scan_joins_a_literal_continued_on_the_next_line). Docs: docs/localization-parity.md (Georgian row, counted 2026-11-14), docs/target-app-parity.md. --- crates/ui-egui/src/i18n/ka.tsv | 4 ++++ crates/ui-egui/src/i18n/tests.rs | 19 ++++++++++++++++++- docs/localization-parity.md | 2 +- docs/target-app-parity.md | 1 + 4 files changed, 24 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index fc649cd87a..1ff28d55bd 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -7612,3 +7612,7 @@ font-script Japanese იაპონური Grommets ლუვერები Grommet Inset ლუვერების დაშორება კიდიდან Diameter დიამეტრი + +# Messages of document.activate and of PDF export's knockout groups. +@msg `index` must be a whole number `index` უნდა იყოს მთელი რიცხვი +@msg knockout groups with too many overlapping translucent elements are written as PDF knockout groups: their translucent elements knock out what they cover fully ჩაკვეთილი ჯგუფები, რომლებშიც ზედმეტად ბევრი ერთმანეთზე გადაფარებული ნახევრად გამჭვირვალე ელემენტია, PDF-ის ჩაკვეთილ ჯგუფებად იწერება: მათი ნახევრად გამჭვირვალე ელემენტები მთლიანად ჩაკვეთენ იმას, რასაც ფარავენ diff --git a/crates/ui-egui/src/i18n/tests.rs b/crates/ui-egui/src/i18n/tests.rs index 4f9f03e5f6..68acecb418 100644 --- a/crates/ui-egui/src/i18n/tests.rs +++ b/crates/ui-egui/src/i18n/tests.rs @@ -2702,6 +2702,21 @@ fn run() -> Result<()> { assert!(source_messages(code, &[], &Default::default()).is_empty()); } +/// A message split over lines with a `\` at the end of a line is read as Rust reads it: the line +/// break and the next line's leading whitespace are dropped, with LF and CRLF line endings, in a +/// constant and in a literal an error takes. +#[test] +fn message_scan_joins_a_literal_continued_on_the_next_line() { + for eol in ["\n", "\r\n"] { + let declared = format!("const LONG: &str = \"too many elements: \\{eol} drawn as a plain group\";{eol}"); + let consts = std::collections::BTreeMap::from_iter(str_consts(&declared).into_iter().map(|(name, value)| (name, vec![value]))); + assert_eq!(consts.get("LONG"), Some(&vec!["too many elements: drawn as a plain group".to_string()]), "{eol:?}"); + let code = format!("fn run() {{ let _ = Err(\"the file \\{eol}\t\t is too large\"); let _ = Err(LONG); }}{eol}"); + let found: std::collections::BTreeSet = source_messages(&code, &[], &consts).into_iter().collect(); + assert_eq!(found.iter().collect::>(), ["the file is too large", "too many elements: drawn as a plain group"], "{eol:?}"); + } +} + /// The scan reads the message of each of the plug-in host's [`ERROR_HELPERS`]: a literal, a /// `format!` string with or without a `&` before it, after the location of `out_err` (a /// `format!` string too), the number and range of `in_range`, the number and location of `unit`, @@ -4520,7 +4535,8 @@ fn without_test_module(text: &str) -> &str { text } -/// The text of a string literal whose opening quote was just read, escapes resolved. +/// The text of a string literal whose opening quote was just read, escapes resolved. A `\` at the +/// end of a line drops the line break and the whitespace that starts the next line, as Rust does. fn string_literal(s: &str) -> Option { let mut out = String::new(); let mut it = s.chars(); @@ -4530,6 +4546,7 @@ fn string_literal(s: &str) -> Option { '\\' => match it.next()? { 'n' => out.push('\n'), 't' => out.push('\t'), + '\n' | '\r' => it = it.as_str().trim_start_matches([' ', '\t', '\n', '\r']).chars(), c => out.push(c), }, c => out.push(c), diff --git a/docs/localization-parity.md b/docs/localization-parity.md index 9080695a8e..50a2c8d18f 100644 --- a/docs/localization-parity.md +++ b/docs/localization-parity.md @@ -66,7 +66,7 @@ plus review. Native-speaker review is human work and isn't in the hours. | Swedish | `sv` | 5,251 rows, 795 of them `@msg` (counted 2026-10-21): menus, `tl!` literals and messages complete when counted; one/other plurals | full; native review welcome | | Bulgarian | `bg` | 5,245 rows, 763 of them `@msg` (counted 2026-10-21): menus and `tl!` literals complete when counted; its messages are partial | full; AI-drafted, native review pending | | Greek | `el` | 5,251 rows, 795 of them `@msg` (counted 2026-10-21): menus, `tl!` literals and messages complete when counted | full; native review welcome | -| Georgian | `ka` | 5,200 rows (counted 2026-10-21): menus, panels, dialogs, plurals (one count-neutral form) and messages, tested complete; reviewed by a native speaker | full | +| Georgian | `ka` | 7,512 rows, 1,640 of them `@msg` and 48 `@msgplural` (counted 2026-11-14): menus, panels, dialogs and plurals (one count-neutral form); the untranslated report lists 1,927 missing Georgian messages, and 53 messages that no language has a row for | full | | Turkish | `tr` | 5,558 rows, 880 of them `@msg` (counted 2026-10-28); 6 menu strings and the default swatch names still fall back to English | full | | Indonesian | `id` | 5,531 rows, 788 of them `@msg` (counted 2026-10-28): menus and `tl!` literals complete when counted; its messages are partial; one plural form | full | | Catalan | `ca` | 5,626 rows, 881 of them `@msg` (counted 2026-10-28): menus, `tl!` literals and messages complete when counted; one/other plurals; every `ca-*` locale resolves here | full; AI-drafted, native review welcome | diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 7e36c7f318..3aa4727511 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -903,6 +903,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - The History panel, Edit › Undo and Edit › Redo translate the names of the steps that apply or redefine a character or paragraph style and of the step that redefines a graphic style: each such step keeps its template (`Apply {name}`, `Redefine {name}`, `Redefine Graphic Style “{name}”`) and the style's name, every complete catalog has a row for each template, and the panel and the menu show the style's name as the document holds it, except the Normal styles' names, which they show in the interface language (`steps_named_after_a_style_list_the_template_around_the_name`, `undo_and_redo_name_a_style_step_around_the_style_name`). - 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 untranslated-strings report reads a message written over two lines with a `\` at the end of the first as one line, the text the program shows, and the Georgian catalog (`ka`) translates the two messages the report then listed as missing from every language: `document.activate`'s `` `index` must be a whole number `` and PDF export's warning about knockout groups with too many translucent elements (`message_scan_joins_a_literal_continued_on_the_next_line`, `untranslated_report`). See [localization-parity.md](localization-parity.md). - 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 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`). - The Traditional Chinese catalog (`crates/ui-egui/src/i18n/zh-hant.tsv`) has an `@msg` row for the status and error messages the untranslated report (`untranslated_report`) finds in the sources, 3,438 `@msg` rows in all: the errors of commands, scripts, file import and export and plug-ins. The report lists 40 Traditional Chinese messages: open #7211, #7116 and #7330 add the rows for 38 of them, and the other 2 have no row in any catalog. A message with two placeholders in a row (`Template::parse` in `crates/ui-egui/src/i18n/catalog.rs`) is still shown in English.