G9: expand Ukrainian UI coverage (#333)

Translate the 396 current panel catalog rows and route Ukrainian Reveal
labels for Finder, Explorer and File Manager. Enforce catalog parity,
placeholder preservation and platform label coverage; update language docs.
Use a fixed-size OCIO row iterator to satisfy the current Clippy gate.

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
Dmytro Matviichuk
2026-10-09 20:54:14 +02:00
co-authored by Codex
parent 30aaddf7c2
commit 4823c08d9c
6 changed files with 491 additions and 6 deletions
+35 -1
View File
@@ -80,7 +80,17 @@ fn supported(locale: Option<&str>) -> &'static str {
}
pub(crate) fn label<'a>(app: &EffectcraftApp, command: &str, source: &'a str) -> &'a str {
match language(app) {
let language = language(app);
// The engine names the platform's file manager before the catalog sees the label. These
// two commands keep their ids, but on Windows/Linux their source is no longer "Finder".
if language == "uk" && matches!(command, "file.revealInFinder" | "layer.revealInFinder") {
match source {
"Reveal in Explorer" => return "Показати у Провіднику",
"Reveal in File Manager" => return "Показати у файловому менеджері",
_ => {}
}
}
match language {
"ja" => lookup(JAPANESE, command, source),
"zh-hans" => lookup(SIMPLIFIED_CHINESE, command, source),
"zh-hant" => lookup(TRADITIONAL_CHINESE, command, source),
@@ -2727,6 +2737,30 @@ mod tests {
assert_eq!(japanese_keys, ukrainian_keys, "the languages must translate the same entries");
}
/// Exercise each engine spelling on every host: a macOS-only run must still catch a
/// Windows/Linux catalog miss, while filenames and unrelated commands stay untouched.
#[test]
fn ukrainian_reveal_labels_follow_the_platform_file_manager() {
let mut app = EffectcraftApp::new(effectcraft_engine::Session::default());
app.session.execute("prefs.set", json!({"key": "general.language", "value": "uk"})).unwrap();
for command in ["file.revealInFinder", "layer.revealInFinder"] {
for (source, translated) in [
("Reveal in Finder", "Показати у Finder"),
("Reveal in Explorer", "Показати у Провіднику"),
("Reveal in File Manager", "Показати у файловому менеджері"),
] {
let e = MenuEntry { label: source.into(), command: command.into(), params: json!({"item": "My file.mp4"}), shortcut: None };
assert_eq!(label(&app, command, source), translated);
assert_eq!(entry(&app, &e, source.into()), translated);
assert_eq!(label(&app, "file.openRecent", source), source);
}
assert_eq!(label(&app, command, "My file.mp4"), "My file.mp4");
}
app.session.execute("prefs.set", json!({"key": "general.language", "value": "en"})).unwrap();
assert_eq!(label(&app, "file.revealInFinder", "Reveal in Explorer"), "Reveal in Explorer");
assert_eq!(label(&app, "layer.revealInFinder", "Reveal in File Manager"), "Reveal in File Manager");
}
#[test]
fn language_changes_native_labels_without_changing_commands_or_parameters() {
let mut app = EffectcraftApp::new(effectcraft_engine::Session::default());