From 80897d8bd4a8ea20bbc5988dd56c57de31a99112 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 17 Nov 2026 20:25:52 -0800 Subject: [PATCH] i18n: Linear Trend and Growth Trend have a row in every catalog The right-drag fill menu shows both labels through lang.tr, and no catalog had a row for them, so every interface language showed them in English. Each of the 18 catalogs now translates them, and a test checks that none falls back to English. --- crates/ui-egui/src/i18n.rs | 15 +++++++++++++++ crates/ui-egui/src/i18n/cs.rs | 2 ++ crates/ui-egui/src/i18n/de.rs | 2 ++ crates/ui-egui/src/i18n/el.rs | 2 ++ crates/ui-egui/src/i18n/es.rs | 2 ++ crates/ui-egui/src/i18n/fr.rs | 2 ++ crates/ui-egui/src/i18n/it.rs | 2 ++ crates/ui-egui/src/i18n/ja.rs | 2 ++ crates/ui-egui/src/i18n/ko.rs | 2 ++ crates/ui-egui/src/i18n/nl.rs | 2 ++ crates/ui-egui/src/i18n/pl.rs | 2 ++ crates/ui-egui/src/i18n/pt.rs | 2 ++ crates/ui-egui/src/i18n/ro.rs | 2 ++ crates/ui-egui/src/i18n/ru.rs | 2 ++ crates/ui-egui/src/i18n/sr.rs | 2 ++ crates/ui-egui/src/i18n/tr.rs | 2 ++ crates/ui-egui/src/i18n/uk.rs | 2 ++ crates/ui-egui/src/i18n/vi.rs | 2 ++ crates/ui-egui/src/i18n/zh.rs | 2 ++ 19 files changed, 51 insertions(+) diff --git a/crates/ui-egui/src/i18n.rs b/crates/ui-egui/src/i18n.rs index 0ffd0ad09..619b2830c 100644 --- a/crates/ui-egui/src/i18n.rs +++ b/crates/ui-egui/src/i18n.rs @@ -418,6 +418,21 @@ mod tests { } } + /// The right-drag fill menu's Linear Trend and Growth Trend have a row in every catalog, with + /// no English fallback. + #[test] + fn trend_fill_labels_are_translated_in_every_catalog() { + for key in ["Linear Trend", "Growth Trend"] { + assert_eq!(Language::En.tr(key), key); + for language in Language::ALL.into_iter().filter(|l| *l != Language::En) { + let code = language.code(); + let shown = language.translated(key).unwrap_or_else(|| panic!("{code}: no row for {key:?}")); + assert!(!shown.trim().is_empty() && !shown.contains('\n'), "{code}: bad translation of {key:?}: {shown:?}"); + assert_ne!(shown, key, "{code}: the row for {key:?} is still English"); + } + } + } + #[test] fn translations_never_show_the_context_prefix() { // `tr` returns a found translation as it is, so a catalog that keeps `context|` in its diff --git a/crates/ui-egui/src/i18n/cs.rs b/crates/ui-egui/src/i18n/cs.rs index a2d1312be..ee77b01d6 100644 --- a/crates/ui-egui/src/i18n/cs.rs +++ b/crates/ui-egui/src/i18n/cs.rs @@ -3,6 +3,8 @@ /// Returns the Czech translation for `text`, or `None` so callers fall back to English. pub(super) fn translate(text: &str) -> Option<&'static str> { Some(match text { + "Linear Trend" => "Lineární trend", + "Growth Trend" => "Exponenciální trend", "Diagram" => "Diagram", "Decorative Text" => "Ozdobný text", "Paste" => "Vložit", diff --git a/crates/ui-egui/src/i18n/de.rs b/crates/ui-egui/src/i18n/de.rs index fa4303851..9a4f14b5c 100644 --- a/crates/ui-egui/src/i18n/de.rs +++ b/crates/ui-egui/src/i18n/de.rs @@ -4,6 +4,8 @@ /// Returns the German translation for `text`, or `None` so callers fall back to English. pub(super) fn translate(text: &str) -> Option<&'static str> { Some(match text { + "Linear Trend" => "Linearer Trend", + "Growth Trend" => "Exponentieller Trend", "Diagram" => "Schema", "Decorative Text" => "Dekorativer Text", "Paste" => "Einfügen", diff --git a/crates/ui-egui/src/i18n/el.rs b/crates/ui-egui/src/i18n/el.rs index 2a7449fd6..3d97667be 100644 --- a/crates/ui-egui/src/i18n/el.rs +++ b/crates/ui-egui/src/i18n/el.rs @@ -5,6 +5,8 @@ /// Returns the Greek translation for `text`, or `None` so callers fall back to English. pub(super) fn translate(text: &str) -> Option<&'static str> { Some(match text { + "Linear Trend" => "Γραμμική τάση", + "Growth Trend" => "Εκθετική τάση", "Diagram" => "Διάγραμμα", "Decorative Text" => "Διακοσμητικό κείμενο", "Paste" => "Επικόλληση", diff --git a/crates/ui-egui/src/i18n/es.rs b/crates/ui-egui/src/i18n/es.rs index df0fb4384..93375a398 100644 --- a/crates/ui-egui/src/i18n/es.rs +++ b/crates/ui-egui/src/i18n/es.rs @@ -5,6 +5,8 @@ /// Returns the Spanish translation for `text`, or `None` so callers fall back to English. pub(super) fn translate(text: &str) -> Option<&'static str> { Some(match text { + "Linear Trend" => "Tendencia lineal", + "Growth Trend" => "Tendencia geométrica", "Diagram" => "Diagrama", "Decorative Text" => "Texto decorativo", "Paste" => "Pegar", diff --git a/crates/ui-egui/src/i18n/fr.rs b/crates/ui-egui/src/i18n/fr.rs index 31e42afe5..7608927fd 100644 --- a/crates/ui-egui/src/i18n/fr.rs +++ b/crates/ui-egui/src/i18n/fr.rs @@ -3,6 +3,8 @@ /// Returns the French translation for `text`, or `None` so callers fall back to English. pub(super) fn translate(text: &str) -> Option<&'static str> { Some(match text { + "Linear Trend" => "Tendance linéaire", + "Growth Trend" => "Tendance géométrique", "Diagram" => "Diagramme", "Decorative Text" => "Texte décoratif", "Different First Page" => "Première page différente", diff --git a/crates/ui-egui/src/i18n/it.rs b/crates/ui-egui/src/i18n/it.rs index 24fa45c95..f430c8c76 100644 --- a/crates/ui-egui/src/i18n/it.rs +++ b/crates/ui-egui/src/i18n/it.rs @@ -5,6 +5,8 @@ /// Returns the Italian translation for `text`, or `None` so callers fall back to English. pub(super) fn translate(text: &str) -> Option<&'static str> { Some(match text { + "Linear Trend" => "Tendenza lineare", + "Growth Trend" => "Tendenza esponenziale", "Diagram" => "Diagramma", "Decorative Text" => "Testo decorativo", "Paste" => "Incolla", diff --git a/crates/ui-egui/src/i18n/ja.rs b/crates/ui-egui/src/i18n/ja.rs index a659da744..9c85de1ba 100644 --- a/crates/ui-egui/src/i18n/ja.rs +++ b/crates/ui-egui/src/i18n/ja.rs @@ -1027,6 +1027,8 @@ pub(super) const DIALOGS: &[(&str, &str)] = &[ /// Portuguese catalog has no entry for them either). Kept apart so the two catalogs above keep the /// same key set; it never overlaps them. pub(super) const EXTRA: &[(&str, &str)] = &[ + ("Linear Trend", "線形近似"), + ("Growth Trend", "乗算近似"), ("Cut (⌘X)", "切り取り (⌘X)"), ("Copy (⌘C)", "コピー (⌘C)"), ("Bold (⌘B)", "太字 (⌘B)"), diff --git a/crates/ui-egui/src/i18n/ko.rs b/crates/ui-egui/src/i18n/ko.rs index 9d6d3644a..09483b2a3 100644 --- a/crates/ui-egui/src/i18n/ko.rs +++ b/crates/ui-egui/src/i18n/ko.rs @@ -3,6 +3,8 @@ /// Returns the Korean translation for `text`, or `None` so callers fall back to English. pub(super) fn translate(text: &str) -> Option<&'static str> { Some(match text { + "Linear Trend" => "선형 추세", + "Growth Trend" => "지수 추세", "Diagram" => "다이어그램", "Decorative Text" => "장식 텍스트", "Paste" => "붙여넣기", diff --git a/crates/ui-egui/src/i18n/nl.rs b/crates/ui-egui/src/i18n/nl.rs index 44a1b3815..0dd33644d 100644 --- a/crates/ui-egui/src/i18n/nl.rs +++ b/crates/ui-egui/src/i18n/nl.rs @@ -3,6 +3,8 @@ /// Returns the Dutch translation for `text`, or `None` so callers fall back to English. pub(super) fn translate(text: &str) -> Option<&'static str> { Some(match text { + "Linear Trend" => "Lineaire trend", + "Growth Trend" => "Groeitrend", "Diagram" => "Diagram", "Decorative Text" => "Decoratieve tekst", "Paste" => "Plakken", diff --git a/crates/ui-egui/src/i18n/pl.rs b/crates/ui-egui/src/i18n/pl.rs index d232a6e0d..9fcff2467 100644 --- a/crates/ui-egui/src/i18n/pl.rs +++ b/crates/ui-egui/src/i18n/pl.rs @@ -1,6 +1,8 @@ /// Returns the Polish translation for `text`, or `None` so callers fall back to English. pub(super) fn translate(text: &str) -> Option<&'static str> { Some(match text { + "Linear Trend" => "Trend liniowy", + "Growth Trend" => "Trend wykładniczy", "Diagram" => "Diagram", "Decorative Text" => "Tekst ozdobny", "Paste" => "Wklej", diff --git a/crates/ui-egui/src/i18n/pt.rs b/crates/ui-egui/src/i18n/pt.rs index d93054309..f52cf570a 100644 --- a/crates/ui-egui/src/i18n/pt.rs +++ b/crates/ui-egui/src/i18n/pt.rs @@ -4,6 +4,8 @@ /// Returns the Portuguese translation for `text`, or `None` so callers fall back to English. pub(super) fn translate(text: &str) -> Option<&'static str> { Some(match text { + "Linear Trend" => "Tendência Linear", + "Growth Trend" => "Tendência de Crescimento", "Diagram" => "Diagrama", "Decorative Text" => "Texto decorativo", "Paste" => "Colar", diff --git a/crates/ui-egui/src/i18n/ro.rs b/crates/ui-egui/src/i18n/ro.rs index 0876ac50f..b04facf93 100644 --- a/crates/ui-egui/src/i18n/ro.rs +++ b/crates/ui-egui/src/i18n/ro.rs @@ -8,6 +8,8 @@ /// Returns the Romanian translation for `text`, or `None` so callers fall back to English. pub(super) fn translate(text: &str) -> Option<&'static str> { Some(match text { + "Linear Trend" => "Tendință liniară", + "Growth Trend" => "Tendință de creștere", "Diagram" => "Schemă", "Decorative Text" => "Text decorativ", "Paste" => "Lipire", diff --git a/crates/ui-egui/src/i18n/ru.rs b/crates/ui-egui/src/i18n/ru.rs index f422bcb93..48a7f10b4 100644 --- a/crates/ui-egui/src/i18n/ru.rs +++ b/crates/ui-egui/src/i18n/ru.rs @@ -3,6 +3,8 @@ /// Returns the Russian translation for `text`, or `None` so callers fall back to English. pub(super) fn translate(text: &str) -> Option<&'static str> { Some(match text { + "Linear Trend" => "Линейное приближение", + "Growth Trend" => "Экспоненциальное приближение", "Diagram" => "Схема", "Decorative Text" => "Декоративный текст", "Paste" => "Вставить", diff --git a/crates/ui-egui/src/i18n/sr.rs b/crates/ui-egui/src/i18n/sr.rs index fa9d1285a..4212dcef5 100644 --- a/crates/ui-egui/src/i18n/sr.rs +++ b/crates/ui-egui/src/i18n/sr.rs @@ -3,6 +3,8 @@ /// Returns the Serbian translation for `text`, or `None` so callers fall back to English. pub(super) fn translate(text: &str) -> Option<&'static str> { Some(match text { + "Linear Trend" => "Linearni trend", + "Growth Trend" => "Eksponencijalni trend", "Diagram" => "Dijagram", "Decorative Text" => "Ukrasni tekst", "Paste" => "Nalepi", diff --git a/crates/ui-egui/src/i18n/tr.rs b/crates/ui-egui/src/i18n/tr.rs index 35143bf9a..91f5cb85b 100644 --- a/crates/ui-egui/src/i18n/tr.rs +++ b/crates/ui-egui/src/i18n/tr.rs @@ -4,6 +4,8 @@ /// Returns the Turkish translation for `text`, or `None` so callers fall back to English. pub(super) fn translate(text: &str) -> Option<&'static str> { Some(match text { + "Linear Trend" => "Doğrusal Eğilim", + "Growth Trend" => "Büyüme Eğilimi", "Diagram" => "Diyagram", "Decorative Text" => "Dekoratif Metin", "Paste" => "Yapıştır", diff --git a/crates/ui-egui/src/i18n/uk.rs b/crates/ui-egui/src/i18n/uk.rs index 4374cc135..6d3e5e88b 100644 --- a/crates/ui-egui/src/i18n/uk.rs +++ b/crates/ui-egui/src/i18n/uk.rs @@ -3,6 +3,8 @@ /// Returns the Ukrainian translation for `text`, or `None` so callers fall back to English. pub(super) fn translate(text: &str) -> Option<&'static str> { Some(match text { + "Linear Trend" => "Лінійне наближення", + "Growth Trend" => "Експоненційне наближення", "Diagram" => "Схема", "Decorative Text" => "Декоративний текст", "Paste" => "Вставити", diff --git a/crates/ui-egui/src/i18n/vi.rs b/crates/ui-egui/src/i18n/vi.rs index 62462cc4b..ab2b2ff50 100644 --- a/crates/ui-egui/src/i18n/vi.rs +++ b/crates/ui-egui/src/i18n/vi.rs @@ -4,6 +4,8 @@ /// Returns the Vietnamese translation for `text`, or `None` so callers fall back to English. pub(super) fn translate(text: &str) -> Option<&'static str> { Some(match text { + "Linear Trend" => "Xu hướng tuyến tính", + "Growth Trend" => "Xu hướng tăng trưởng", "Diagram" => "Sơ đồ", "Decorative Text" => "Chữ trang trí", "Paste" => "Dán", diff --git a/crates/ui-egui/src/i18n/zh.rs b/crates/ui-egui/src/i18n/zh.rs index e7ff3fc75..1ac64a75d 100644 --- a/crates/ui-egui/src/i18n/zh.rs +++ b/crates/ui-egui/src/i18n/zh.rs @@ -3,6 +3,8 @@ /// Returns the Chinese translation for `text`, or `None` so callers fall back to English. pub(super) fn translate(text: &str) -> Option<&'static str> { Some(match text { + "Linear Trend" => "线性趋势", + "Growth Trend" => "等比趋势", "Diagram" => "图示", "Decorative Text" => "装饰文字", "Paste" => "粘贴",