SolidCraft: an open-source parametric 3D CAD application built in pure Rust. Desktop, web, and automation through MCP.
Timeline: the tooltip hint is translated (Part of #4370) (#4398)
raykholo88f079bd8c49
diff --git a/assets/locales/de.json b/assets/locales/de.jsonindex b4a0dcf676..4d13b2b672 100644--- a/assets/locales/de.json+++ b/assets/locales/de.json@@ -1362,6 +1362,7 @@"thread.designation": "Bezeichnung","thread.iso_metric": "ISO metrisch","thread.select_size": "Größe wählen",+ "timeline.feature_hint": "Doppelklicken zum Bearbeiten · Ziehen zum Neuordnen · Rechtsklicken für weitere Optionen","timeline.group": "Neuen Merkmalsordner anlegen","timeline.move_many": "Zeitleistenelemente verschieben","timeline.move_to_group": "Merkmale in Ordner verschieben",diff --git a/assets/locales/en.json b/assets/locales/en.jsonindex 8f016107be..b013b10da9 100644--- a/assets/locales/en.json+++ b/assets/locales/en.json@@ -2107,6 +2107,7 @@"timeline.delete_after_marker_one": "Delete 1 Feature After History Marker","timeline.delete_after_marker_other": "Delete {count} Features After History Marker","timeline.delete_many": "Delete {count} Selected Features",+ "timeline.feature_hint": "Double-click to edit · drag to reorder · right-click for more","timeline.group": "New Feature Folder","timeline.move_many": "Move Timeline Items","timeline.move_to_group": "Move Features to Folder",diff --git a/assets/locales/ja.json b/assets/locales/ja.jsonindex 77df0d5031..324bd212a0 100644--- a/assets/locales/ja.json+++ b/assets/locales/ja.json@@ -2107,6 +2107,7 @@"timeline.delete_after_marker_one": "履歴マーカー以降の 1 個のフィーチャーを削除","timeline.delete_after_marker_other": "履歴マーカー以降の {count} 個のフィーチャーを削除","timeline.delete_many": "選択した {count} 個のフィーチャーを削除",+ "timeline.feature_hint": "ダブルクリックで編集 · ドラッグで並べ替え · 右クリックでその他の操作","timeline.group": "フィーチャーフォルダを新規作成","timeline.move_many": "タイムライン項目を移動","timeline.move_to_group": "フィーチャーをフォルダへ移動",diff --git a/assets/locales/ko.json b/assets/locales/ko.jsonindex 3393ebab65..1113f36753 100644--- a/assets/locales/ko.json+++ b/assets/locales/ko.json@@ -1529,6 +1529,7 @@"thread.designation": "호칭","thread.iso_metric": "ISO 미터","thread.select_size": "크기 선택",+ "timeline.feature_hint": "두 번 클릭하여 편집 · 드래그하여 순서 변경 · 마우스 오른쪽 버튼을 클릭하여 더 보기","timeline.group": "새 특성 폴더","timeline.move_many": "타임라인 항목 이동","timeline.move_to_group": "특성을 폴더로 이동",diff --git a/assets/locales/zh.json b/assets/locales/zh.jsonindex 444b7d754b..4b9f628116 100644--- a/assets/locales/zh.json+++ b/assets/locales/zh.json@@ -2107,6 +2107,7 @@"timeline.delete_after_marker_one": "删除历史标记之后的 1 个特征","timeline.delete_after_marker_other": "删除历史标记之后的 {count} 个特征","timeline.delete_many": "删除所选的 {count} 个特征",+ "timeline.feature_hint": "双击编辑 · 拖动以重新排序 · 右键查看更多操作","timeline.group": "新建特征文件夹","timeline.move_many": "移动时间线项目","timeline.move_to_group": "将特征移至文件夹",diff --git a/crates/ui-egui/src/i18n.rs b/crates/ui-egui/src/i18n.rsindex 23530dfd6f..49f409c1a9 100644--- a/crates/ui-egui/src/i18n.rs+++ b/crates/ui-egui/src/i18n.rs@@ -283,6 +283,22 @@ mod tests {assert_eq!(alias.label("original unknown caption"), "original unknown caption");}+ #[test]+ fn timeline_feature_hint_comes_from_the_catalog() {+ let id = "timeline.feature_hint";+ let english = "Double-click to edit · drag to reorder · right-click for more";+ assert_eq!(ENGLISH.messages().get(id).map(String::as_str), Some(english));+ for language in ["en", "ja", "zh", "de", "ko", "es"] {+ let _scope = scope(language);+ let hint = tr(id);+ assert_eq!(hint, Locale::for_language(language).text(id));+ assert_ne!(hint, id);+ if ["ja", "zh", "de", "ko"].contains(&language) {+ assert_ne!(hint, english, "{language}: the hint must be translated");+ }+ }+ }+/// English first, then by id, so adding a locale edits only its own line.#[test]fn locales_are_listed_english_first_then_by_id() {diff --git a/crates/ui-egui/src/timeline.rs b/crates/ui-egui/src/timeline.rsindex 546e27898b..42c3e2d68f 100644--- a/crates/ui-egui/src/timeline.rs+++ b/crates/ui-egui/src/timeline.rs@@ -470,7 +470,8 @@ fn timeline_contents(app: &mut SolveApp, ui: &mut egui::Ui, floating: bool) {if let Some(r) = res {tip += &format!("\n{:.1} ms", r.ms);}- tip += "\nDouble-click to edit · drag to reorder · right-click for more";+ tip.push('\n');+ tip.push_str(crate::i18n::tr("timeline.feature_hint"));if resp.drag_started() {drag = Some(Drag::Feature(*id));}