PhotoCraft: An open-source, photo editor written by scratch in pure Rust
i18n(uk): translate color picker titles and rasterization warnings (#6153)
PerchenkoAnton8d2e615ab93d
diff --git a/crates/ui-egui/src/i18n/live_tests.rs b/crates/ui-egui/src/i18n/live_tests.rsindex 89c47ef1a..7d8d6457e 100644--- a/crates/ui-egui/src/i18n/live_tests.rs+++ b/crates/ui-egui/src/i18n/live_tests.rs@@ -42,6 +42,46 @@ fn ukrainian_native_app_menu_keeps_product_and_language_names() {});}+#[test]+fn ukrainian_color_picker_titles_draw_in_the_selected_language() {+ with_language(Lang::EN, || {+ for (target, expected) in [("foreground", "Вибір кольору (основний колір)"), ("background", "Вибір кольору (колір тла)")]+ {+ let mut h = harness();+ h.state_mut().run("prefs.set", json!({"path": "interface.language", "value": "uk"})).unwrap();+ crate::color_picker_ui::open(h.state_mut(), target);+ h.run_steps(4);+ let text = drawn_text(&h);+ assert!(text.iter().any(|text| text == expected), "missing title {expected}");+ assert!(!text.iter().any(|text| text.starts_with("Color Picker")), "no English picker title");+ }+ assert_eq!(tr(lang("uk"), "Color Picker (Custom Canvas Color)"), "Вибір кольору (власний колір полотна)");+ });+}++#[test]+fn ukrainian_rasterize_prompts_explain_the_loss_of_editable_content() {+ use crate::rasterize_prompt::Kind;++ for kind in Kind::ALL {+ let translated = tr(lang("uk"), kind.message());+ assert_ne!(translated, kind.message(), "{kind:?}: the warning must be translated");+ assert!(translated.contains("більше не можна буде редагувати"), "{kind:?}: explain the loss of editability");+ }+ with_language(Lang::EN, || {+ let mut h = harness();+ h.state_mut().run("prefs.set", json!({"path": "interface.language", "value": "uk"})).unwrap();+ h.state_mut().run("type.create", json!({"text": "Editable text"})).unwrap();+ let layer = h.state().session.active().unwrap().active_layer.unwrap();+ crate::rasterize_prompt::open(h.state_mut(), Kind::Type, layer, crate::state::Tool::Brush, [10.0, 10.0, 1.0]);+ h.run_steps(4);+ let expected = tr(lang("uk"), Kind::Type.message());+ let text = drawn_text(&h);+ assert!(text.iter().any(|text| text == expected), "the actual dialog draws the Ukrainian warning");+ assert!(!text.iter().any(|text| text == Kind::Type.message()));+ });+}+#[test]fn french_and_korean_plural_messages_keep_placeholders() {for (n, expected) in [(0, "0 élément"), (1, "1 élément"), (2, "2 éléments"), (21, "21 éléments")] {diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsvindex 3de031881..37851e90f 100644--- a/crates/ui-egui/src/i18n/uk.tsv+++ b/crates/ui-egui/src/i18n/uk.tsv@@ -3930,3 +3930,11 @@ curves Smooth ЗгладитиIncrease Brush Size Збільшити розмір пензляDecrease Brush Hardness Зменшити жорсткість пензляIncrease Brush Hardness Збільшити жорсткість пензля+# Dynamic color-picker titles and warnings about losing editable layer content.+ Color Picker (Background Color) Вибір кольору (колір тла)+ Color Picker (Foreground Color) Вибір кольору (основний колір)+ Color Picker (Custom Canvas Color) Вибір кольору (власний колір полотна)+ This type layer must be rasterized before proceeding. Its text will no longer be editable. Rasterize the type? Щоб продовжити, потрібно растеризувати цей текстовий шар. Після цього його текст більше не можна буде редагувати. Растеризувати текст?+ This shape layer must be rasterized before proceeding. It will no longer be editable as a shape. Rasterize the shape? Щоб продовжити, потрібно растеризувати цей шар фігури. Після цього його більше не можна буде редагувати як фігуру. Растеризувати фігуру?+ This Smart Object must be rasterized before proceeding. Its contents will no longer be editable. Rasterize the Smart Object? Щоб продовжити, потрібно растеризувати цей смартоб’єкт. Після цього його вміст більше не можна буде редагувати. Растеризувати смартоб’єкт?+ This fill layer must be rasterized before proceeding. Its fill content will no longer be editable. Rasterize the layer? Щоб продовжити, потрібно растеризувати цей шар заливки. Після цього його заливку більше не можна буде редагувати. Растеризувати шар?