Skip to content

EffectCraft: An open-source motion graphics and compositing tool written by scratch in pure Rust

i18n(ja): Paint and Generate must not draw the same category name

zitann2020373112b38b27
diff --git a/crates/ui-egui/src/i18n/effects.rs b/crates/ui-egui/src/i18n/effects.rs
index 29a850260..cbcc192da 100644
--- a/crates/ui-egui/src/i18n/effects.rs
+++ b/crates/ui-egui/src/i18n/effects.rs
@@ -496,7 +496,7 @@ const JAPANESE_CATEGORIES: &[(&str, &str)] = &[
("Matte", "マット"),
("Noise & Grain", "ノイズ&グレイン"),
("Obsolete", "旧バージョン"),
- ("Paint", "描画"),
+ ("Paint", "ペイント"),
("Perspective", "遠近"),
("Simulation", "シミュレーション"),
("Stylize", "スタイライズ"),
@@ -1002,3 +1002,21 @@ mod tests {
assert!(!matches("ec.blur.gaussian", "Gaussian Blur", "高斯"));
}
}
+
+#[cfg(test)]
+mod japanese_category_tests {
+ use super::*;
+ use std::collections::HashMap;
+
+ /// Two categories drawing the same Japanese name would make the Effect menu show one name twice and
+ /// leave the user unable to tell them apart. `描画` was both `Generate` and `Paint` before #2583.
+ #[test]
+ fn no_two_categories_share_a_japanese_name() {
+ let mut seen: HashMap<&str, &str> = HashMap::new();
+ for (english, japanese) in JAPANESE_CATEGORIES {
+ if let Some(other) = seen.insert(japanese, english) {
+ panic!("`{english}` and `{other}` both draw as `{japanese}`");
+ }
+ }
+ }
+}