mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-16 20:19:40 +00:00
i18n: French rows use a no-break space before : ; ? ! and inside « »
fr.tsv's header asks for a no-break space before : ; ? ! and inside « », and the typographic apostrophe in elisions. 484 translation cells used an ordinary space, no space before a prose semicolon, or a straight apostrophe. They now use U+00A0 and ’. Code in backticks, quoted values and key/value examples such as `stroke: false` keep their punctuation, and the context and English source columns are unchanged. french_catalog_uses_nonbreaking_prose_punctuation checks every French translation outside backticks.
This commit is contained in:
+484
-484
File diff suppressed because it is too large
Load Diff
@@ -1931,6 +1931,50 @@ fn georgian_rows_have_no_mtavruli() {
|
||||
assert!(caps.is_empty(), "Mtavruli in ka.tsv: {caps:?}");
|
||||
}
|
||||
|
||||
/// French rows follow the typography fr.tsv's header sets: a no-break space before : ; ? ! and inside
|
||||
/// « », and the typographic apostrophe ’ in elisions. Text in backticks is code and is not checked, and
|
||||
/// a straight apostrophe inside double quotes is a literal value.
|
||||
#[test]
|
||||
fn french_catalog_uses_nonbreaking_prose_punctuation() {
|
||||
let (entries, _) = parse_entries(fr().0.source);
|
||||
let letter = |c: Option<char>| c.is_some_and(char::is_alphabetic);
|
||||
let mut bad = Vec::new();
|
||||
for (ctx, src, tr) in &entries {
|
||||
let mut code = false;
|
||||
let prose: Vec<char> = tr
|
||||
.chars()
|
||||
.map(|c| {
|
||||
if c == '`' {
|
||||
code = !code;
|
||||
}
|
||||
if code || c == '`' { '\0' } else { c }
|
||||
})
|
||||
.collect();
|
||||
let mut quoted = false;
|
||||
for (i, &c) in prose.iter().enumerate() {
|
||||
let prev = i.checked_sub(1).map(|j| prose[j]);
|
||||
let next = prose.get(i + 1).copied();
|
||||
if c == '"' {
|
||||
quoted = !quoted;
|
||||
}
|
||||
let fault = match c {
|
||||
':' | ';' | '?' | '!' if prev == Some(' ') => "has an ordinary space before it",
|
||||
';' | '?' | '!' if letter(prev) && next.is_none_or(|n| n == ' ') => "has no space before it",
|
||||
'«' if next == Some(' ') => "has an ordinary space after it",
|
||||
'»' if prev == Some(' ') => "has an ordinary space before it",
|
||||
'\'' if !quoted && letter(prev) && letter(next) => "is a straight apostrophe where an elision takes ’",
|
||||
_ => continue,
|
||||
};
|
||||
bad.push(format!("{ctx}\t{src}: `{c}` {fault}"));
|
||||
}
|
||||
}
|
||||
assert!(bad.is_empty(), "{} French spacing faults:\n{}", bad.len(), bad.join("\n"));
|
||||
}
|
||||
|
||||
fn fr() -> Lang {
|
||||
Lang::from_code("fr").expect("fr registered")
|
||||
}
|
||||
|
||||
fn de() -> Lang {
|
||||
Lang::from_code("de").expect("de registered")
|
||||
}
|
||||
@@ -2616,7 +2660,7 @@ fn plugin_errors_translate_with_their_values() {
|
||||
}
|
||||
assert_eq!(message(de(), &errors[1].0), "Plug-in-Manifest: das Manifest ist 65537 Byte groß (Grenze 65536)");
|
||||
let fr = Lang::from_code("fr").expect("registered");
|
||||
assert!(message(fr, &errors[3].0).ends_with(r#"attendu : {"objects": [...]}"#), "{}", message(fr, &errors[3].0));
|
||||
assert!(message(fr, &errors[3].0).ends_with("attendu\u{a0}: {\"objects\": [...]}"), "{}", message(fr, &errors[3].0));
|
||||
}
|
||||
|
||||
/// The reasons the plug-in host puts inside its errors (what is wrong with a parameter's spec or
|
||||
|
||||
@@ -960,6 +960,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
|
||||
- The Dutch catalog (`crates/ui-egui/src/i18n/nl.tsv`) has an `@msg` row for the status and error messages the untranslated report (`untranslated_report`) finds in the sources, 3,447 `@msg` rows in all. The report lists 41 Dutch messages: the composite font errors, the justification spacing error and the `connect` end error, which open #7211, #7116 and #7330 translate, and three unknown-parameter and range errors (``unknown parameter `{within}{key}`; {why}``, ``unknown parameter `{within}settings.{format}`; {why}`` and `{name} must be {lo}–{hi}{unit} (got {v})`), which open #7353 rewrites so that a catalog row can match them. 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.
|
||||
- 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.
|
||||
- Localised UI: menus (in-window and native), panels, dialogs, toolbar and Preferences read from per-language catalogs (`crates/ui-egui/src/i18n`, see `docs/development.md`); Traditional Chinese (Taiwan), Simplified Chinese (mainland), Japanese, Korean, Vietnamese, German, Spanish, French, Italian, Polish, Brazilian Portuguese, Russian, Ukrainian, Georgian and Catalan ship complete, and Czech covers every menu label (and more), with system-locale detection on macOS, Windows, Linux and the web (the browser's languages, or `?lang=`), a Language preference and, on macOS, a VectorCraft ▸ Language menu. Names are never translated (fonts and their styles, layers, artboards, saved presets, user libraries, custom workspaces, recent files, plug-ins).
|
||||
- The French catalog (`crates/ui-egui/src/i18n/fr.tsv`) follows the typography its header sets: a no-break space (U+00A0) before `:`, `;`, `?` and `!` and inside `« »`, and the typographic apostrophe `’` in elisions. Code in backticks and key/value examples keep their own punctuation. Evidence: `french_catalog_uses_nonbreaking_prose_punctuation` in `crates/ui-egui/src/i18n/tests.rs`.
|
||||
- The Brazilian Portuguese catalog (`crates/ui-egui/src/i18n/pt-br.tsv`) has an `@msg` row for the status and error messages the untranslated report (`untranslated_report`) finds in the sources, 3,563 `@msg` rows in all, including the image export, color profile, color book, swatch exchange file, DXF import and Revolve errors. The report lists 55 Brazilian Portuguese messages: the composite font, SVG filter, read root, graph design, justification order and Blob Brush connect end errors that open #7211, #7378, #7405, #7116 and #7330 translate.
|
||||
The counts that Package's status and question, the folder search of Missing Fonts and Find Linked Files, the modified and missing linked file prompts and the CSS Properties panel's notes show use the interface language's plural forms instead of a fixed "(s)" form. Evidence: `the_missing_links_note_uses_each_count_form` in `crates/ui-egui/src/dialogs/tests_package.rs`, `the_modified_links_question_uses_each_count_form` in `crates/ui-egui/src/dialogs/missing_links.rs`, `search_counts_use_each_count_form` in `crates/ui-egui/src/dialogs/missing_fonts/tests.rs` and `the_unnamed_objects_note_uses_each_count_form` in `crates/ui-egui/src/panels/tests_css_properties.rs`.
|
||||
The status bar's messages for relinked, replaced, updated and embedded images, broken links, linked files that can't be read or changed on disk, images that can't be decoded, added and unavailable fonts, copied CSS, downloads and exports with their notes name one item in the singular and more in the plural, in English and in each language's plural forms (`counted_status_messages_take_the_plural_form` in `crates/ui-egui/src/i18n/tests.rs`).
|
||||
|
||||
Reference in New Issue
Block a user