mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-14 19:26:56 -04:00
i18n: Czech joins the complete-message languages; Czech reads as Czech
Czech is in COMPLETE_MESSAGES, so a new status or error message needs a cs.tsv row too. czech_reads_as_czech checks the vocabulary (Nástroj Pracovní plocha, Vzorník, Operace s cestami, Tah, Výplň), the three plural forms of a layer count, the axis context and a nested message; czech_plurals_have_three_forms now also runs every @plural row through trn for one, few and other counts. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
b9f4d9bd24
commit
a59d8533b7
1 file changed
+41
-1
@@ -801,6 +801,46 @@ fn spaced_catalogs_keep_the_spaces_around_fragments() {
|
||||
fn czech_plurals_have_three_forms() {
|
||||
let forms: Vec<usize> = [0, 1, 2, 4, 5, 11, 21].into_iter().map(plural_czech).collect();
|
||||
assert_eq!(forms, [2, 0, 1, 1, 2, 2, 2]);
|
||||
// Every Czech plural row has the three forms, and each count picks its own.
|
||||
let (entries, _) = parse_entries(cs().0.source);
|
||||
let mut count = 0;
|
||||
for (ctx, src, translated) in entries {
|
||||
if ctx != "@plural" {
|
||||
continue;
|
||||
}
|
||||
count += 1;
|
||||
let (one, other) = src.split_once('|').expect("one|other source");
|
||||
let forms: Vec<_> = translated.split('|').collect();
|
||||
assert_eq!(forms.len(), 3, "{src}");
|
||||
for (n, form) in [(1, 0), (2, 1), (4, 1), (0, 2), (5, 2), (11, 2), (21, 2), (u64::MAX, 2)] {
|
||||
assert_eq!(trn(cs(), n, one, other), forms[form].replace("{n}", &n.to_string()), "{src}: {n}");
|
||||
}
|
||||
}
|
||||
assert!(count >= 13, "Czech plural rows missing");
|
||||
}
|
||||
|
||||
/// Czech uses the vector-illustration vocabulary its users know, has three plural forms
|
||||
/// (one/few/other), and translates the reason inside a message too.
|
||||
#[test]
|
||||
fn czech_reads_as_czech() {
|
||||
for (en, want) in [
|
||||
("Artboard Tool", "Nástroj Pracovní plocha"),
|
||||
("Swatches", "Vzorník"),
|
||||
("Pathfinder", "Operace s cestami"),
|
||||
("Stroke", "Tah"),
|
||||
("Fill", "Výplň"),
|
||||
("Direct Selection Tool", "Nástroj Přímý výběr"),
|
||||
("Save As…", "Uložit jako…"),
|
||||
("Undo", "Zpět"),
|
||||
] {
|
||||
assert_eq!(tr(cs(), en), want);
|
||||
}
|
||||
for (n, word) in [(0, "vrstev"), (1, "vrstva"), (2, "vrstvy"), (4, "vrstvy"), (5, "vrstev"), (11, "vrstev")] {
|
||||
assert_eq!(trn(cs(), n, "{n} Layer", "{n} Layers"), format!("{n} {word}"));
|
||||
}
|
||||
assert_eq!(tr_ctx(cs(), "axis", "Both"), "Obě");
|
||||
let nested = "command `object.group` is not available right now: nothing selected";
|
||||
assert_eq!(message(cs(), nested), "příkaz `object.group` nyní není k dispozici: nic není vybráno");
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -955,7 +995,7 @@ fn align_reflect_and_shear_param_errors_are_translated() {
|
||||
}
|
||||
|
||||
/// Languages whose catalogs cover every status and error message.
|
||||
const COMPLETE_MESSAGES: &[&str] = &["de", "es", "fr", "it", "ja", "ru", "uk"];
|
||||
const COMPLETE_MESSAGES: &[&str] = &["cs", "de", "es", "fr", "it", "ja", "ru", "uk"];
|
||||
|
||||
/// Crates whose error and status messages reach the status bar.
|
||||
const MESSAGE_CRATES: &[&str] = &["ui-egui", "engine", "doc", "format", "svg", "pdf", "eps", "text", "plugins", "metafile", "cad", "trace"];
|
||||
|
||||
Reference in new issue
Block a user