Merge pull request #1189 from Losminek/cs-pr

i18n: complete the Czech (cs) catalog: panels, dialogs, plurals and messages
This commit is contained in:
BFlat 2026-10-11 22:19:42 +07:00 committed by GitHub
commit 15675760c5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 3491 additions and 18 deletions

File diff suppressed because one or more lines are too long

View File

@ -73,3 +73,6 @@ sync_github_name = false
[people.webdevtodayjason]
display_name = "Jason Brashear"
[people.Losminek]
sync_github_name = true

File diff suppressed because it is too large Load Diff

View File

@ -87,8 +87,9 @@ pub static LANGUAGES: [LangInfo; 12] = [
// Japanese: the whole interface (every menu string and `tl!` literal) and the status and error
// messages, keeping the product, workspace and perspective preset names in English (`MENU_KEEP_AS_IS`).
LangInfo { code: "ja", name: "日本語", source: include_str!("ja.tsv"), plural: plural_none, complete_menus: true, catalog: OnceLock::new() },
// Czech: every menu label (`menu_catalogs_translate_every_menu_label`); panels and dialogs not yet.
LangInfo { code: "cs", name: "Čeština", source: include_str!("cs.tsv"), plural: plural_czech, complete_menus: false, catalog: OnceLock::new() },
// Czech: the whole interface (every menu string and `tl!` literal) and the status and error
// messages, with one/few/other plurals, keeping the same names in English as Spanish.
LangInfo { code: "cs", name: "Čeština", source: include_str!("cs.tsv"), plural: plural_czech, complete_menus: true, catalog: OnceLock::new() },
// German: the whole interface and the status and error messages, keeping the same names in
// English as Spanish; every `de-*` locale (`de-DE`, `de-AT`, `de-CH`, `de-LU` …) resolves here.
LangInfo {

View File

@ -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"];