diff --git a/crates/ui-egui/src/i18n/ui.rs b/crates/ui-egui/src/i18n/ui.rs index f31d0951..7848f8e1 100644 --- a/crates/ui-egui/src/i18n/ui.rs +++ b/crates/ui-egui/src/i18n/ui.rs @@ -1060,6 +1060,192 @@ const SIMPLIFIED_CHINESE: &[(&str, &str)] = &[ ("After Effects project", "After Effects 项目"), ("Lottie animation", "Lottie 动画"), ("Project", "项目"), + // Settings dialog pages (engine schema, #1178). + ("General", "常规"), + ("Language", "语言"), + ("Levels of Undo", "撤消级别"), + ("Path Point and Handle Size", "路径点和手柄大小"), + ("Recent Projects Shown", "显示的最近项目数"), + ("Options", "选项"), + ("Show Tool Tips", "显示工具提示"), + ("Create Layers at Composition Start Time", "在合成开始时间创建图层"), + ("Switches Affect Nested Comps", "开关影响嵌套的合成"), + ("Default Spatial Interpolation to Linear", "默认空间插值为线性"), + ("Preserve Constant Vertex and Feather Point Count when Editing Masks", "编辑蒙版时保持固定的顶点和羽化点数"), + ("Synchronize Time of All Related Items", "同步所有相关项目的时间"), + ("Expression Pick Whip Writes Compact English", "表达式拾取器写入紧凑型英语"), + ("Create Split Layers Above Original Layer", "在原始图层上方创建拆分图层"), + ("Use System Color Picker", "使用系统拾色器"), + ( + "EffectCraft always uses its own colour picker (the same on every platform and the web).", + "EffectCraft 始终使用自己的拾色器(在所有平台和网页版中都相同)。", + ), + ("Startup & Repair", "启动和修复"), + ("Show Home Screen When Launching", "启动时显示主屏幕"), + ("Show Home Screen When Opening a Project", "打开项目时显示主屏幕"), + ("Offer to Open the Latest Auto-Save After a Crash", "崩溃后提示打开最新的自动保存"), + ("Window Graphics", "窗口图形"), + ("Automatic", "自动"), + ( + "Window Graphics applies from the next launch. When the graphics driver stops EffectCraft as its window opens, the next launch switches to OpenGL.", + "窗口图形从下次启动起生效。如果图形驱动程序在窗口打开时导致 EffectCraft 停止运行,下次启动将切换为 OpenGL。", + ), + ("Repair", "修复"), + ("Reset Settings", "重置设置"), + ("Reset Keyboard Shortcuts", "重置键盘快捷键"), + ("Empty Disk Cache", "清空磁盘缓存"), + ("New Project Loads Template", "新建项目时加载模板"), + ("Template Project", "模板项目"), + ("Auto-Save", "自动保存"), + ("Automatically Save Projects", "自动保存项目"), + ("Save Every", "保存间隔"), + ("Minutes", "分钟"), + ("Maximum Project Versions", "最大项目版本数"), + ("Auto-Save Location", "自动保存位置"), + ("Next to Project", "项目旁边"), + ("Custom Location", "自定义位置"), + ("Save When Starting Render Queue", "启动渲染队列时保存"), + ("Save Now", "立即保存"), + ("Motion Path", "运动路径"), + ("All Keyframes", "所有关键帧"), + ("No Motion Path", "无运动路径"), + ("No More Than (Seconds)", "不超过(秒)"), + ("No More Than (Keyframes)", "不超过(关键帧)"), + ("Seconds", "秒"), + ("Keyframes", "关键帧"), + ("Display", "显示"), + ("Show Rendering Progress in Info Panel and Flowchart", "在信息面板和流程图中显示渲染进度"), + ("Hardware Accelerate Composition, Layer and Footage Panels", "硬件加速合成、图层和素材面板"), + ("Panels are always drawn by the GPU (wgpu).", "面板始终由 GPU(wgpu)绘制。"), + ("Previews", "预览"), + ("Adaptive Resolution Limit", "自适应分辨率限制"), + ("Show Internal Wireframes", "显示内部线框"), + ("Cache Frames When Idle", "空闲时缓存帧"), + ("Viewer Zoom Quality", "查看器缩放品质"), + ("Faster", "更快"), + ("More Accurate", "更准确"), + ("Display Color Space", "显示色彩空间"), + ("GPU Information...", "GPU 信息..."), + ("Appearance", "外观"), + ("Brightness", "亮度"), + ("UI Scale", "界面缩放"), + ("Labels and Colors", "标签和颜色"), + ("Use Label Color for Layer Handles and Paths", "将标签颜色用于图层手柄和路径"), + ("Use Label Color for Related Tabs", "将标签颜色用于相关选项卡"), + ("Cycle Mask Colors", "循环蒙版颜色"), + ("Use Gradients", "使用渐变"), + ("Menu Bar", "菜单栏"), + ("Grids & Guides", "网格和参考线"), + ("Gridline Every", "网格线间隔"), + ("Subdivisions", "细分"), + ("Style", "样式"), + ("Lines", "线条"), + ("Dashed Lines", "虚线"), + ("Dots", "点"), + ("Horizontal", "水平"), + ("Vertical", "垂直"), + ("Safe Margins", "安全边距"), + ("Action-safe", "动作安全"), + ("Title-safe", "字幕安全"), + ("Labels", "标签"), + ("Text Engine", "文本引擎"), + ("Latin", "拉丁文"), + ("South Asian and Middle Eastern", "南亚和中东"), + ("Show Font Preview", "显示字体预览"), + ("Number of Recent Fonts to Display", "要显示的最近使用字体数"), + ("Show Font Names in English", "以英文显示字体名称"), + ("Still Footage", "静止素材"), + ("Length of Composition", "合成长度"), + ("Duration (Seconds)", "持续时间(秒)"), + ("Still Duration", "静止持续时间"), + ("Sequence Footage", "序列素材"), + ("Report Missing Frames", "报告缺失帧"), + ("Automatically Reload Footage", "自动重新加载素材"), + ("Off", "关闭"), + ("Non-Sequence Footage", "非序列素材"), + ("All Footage", "所有素材"), + ("Ask User", "询问用户"), + ("Guess", "猜测"), + ("Ignore", "忽略"), + ("Straight", "直接"), + ("Premultiplied", "预乘"), + ("Default Drag Import As", "默认拖动导入为"), + ("Footage", "素材"), + ("Composition - Retain Layer Sizes", "合成 - 保持图层大小"), + ("Export", "导出"), + ("Default Output Folder", "默认输出文件夹"), + ("Segment Sequences", "分段序列"), + ("Files per Segment", "每段文件数"), + ("files", "个文件"), + ("Segment Movie Files", "分段影片文件"), + ("Segment Size", "分段大小"), + ("Append Bit Depth to File Name", "将位深度附加到文件名"), + ("Audio", "音频"), + ("Audio Hardware", "音频硬件"), + ("Preview Sample Rate", "预览采样率"), + ("Audio Output Mapping", "音频输出映射"), + ("Left", "左"), + ("Right", "右"), + ("channel", "声道"), + ("Disk", "磁盘"), + ("Disk Cache", "磁盘缓存"), + ("Enable Disk Cache", "启用磁盘缓存"), + ("Maximum Disk Cache Size", "最大磁盘缓存大小"), + ("Disk Cache Folder", "磁盘缓存文件夹"), + ("Media Cache", "媒体缓存"), + ("Database and Cache Folder", "数据库和缓存文件夹"), + ("Conformed Audio Folder", "符合的音频文件夹"), + ("Memory & CPU", "内存和 CPU"), + ("RAM Reserved for Other Applications", "为其他应用程序保留的内存"), + ("Cache Budgets", "缓存预算"), + ("Layer Cache", "图层缓存"), + ("Footage Frame Cache", "素材帧缓存"), + ("Preview (RAM) Cache", "预览(内存)缓存"), + ("Reduce Cache Size When System Is Low on Memory", "系统内存不足时减少缓存大小"), + ("Video", "视频"), + ("Enable Video Preview Output", "启用视频预览输出"), + ("Video Device", "视频设备"), + ("Floating Window", "浮动窗口"), + ("Full Screen", "全屏"), + ("Video Output During Playback", "播放期间的视频输出"), + ("Mirror on Computer Monitor", "在计算机显示器上镜像"), + ("Disable Video Output When in Background", "在后台时禁用视频输出"), + ("Default 3D Renderer", "默认 3D 渲染器"), + ("Show 3D Reference Axes", "显示 3D 参考轴"), + ("Extended Viewer", "扩展查看器"), + ("Realtime Shadows in Draft", "草图模式下的实时阴影"), + ("Scripting & Expressions", "脚本和表达式"), + ("Application Scripting", "应用程序脚本"), + ("Allow Scripts to Write Files and Access Network", "允许脚本写入文件和访问网络"), + ("Warn User When Executing Files", "执行文件时警告用户"), + ("Enable JavaScript Debugger", "启用 JavaScript 调试器"), + ("Expressions Editor", "表达式编辑器"), + ("Font Size", "字体大小"), + ("Syntax Highlighting", "语法高亮"), + ("Line Numbers", "行号"), + ("Auto-complete", "自动完成"), + ("Bracket Matching", "括号匹配"), + ("Word Wrap", "自动换行"), + ("Show Expression Error Banner", "显示表达式错误横幅"), + ( + "Expressions use the JavaScript engine. Script errors report their file and line in the Script Console; there is no step debugger.", + "表达式使用 JavaScript 引擎。脚本错误会在脚本控制台中报告其文件和行号;没有单步调试器。", + ), + ("Roto Brush", "Roto 笔刷"), + ("Segmentation Model", "分割模型"), + ( + "Roto Brush 2.0 and 3.0 use the model chosen here (Version 1.0 always uses the classic engine). Models are open source, downloaded only when you ask, and checked against their published SHA-256.", + "Roto 笔刷 2.0 和 3.0 使用此处选择的模型(1.0 版始终使用经典引擎)。模型均为开源,仅在你请求时下载,并会根据其公布的 SHA-256 进行校验。", + ), + ("Face Tracking", "面部跟踪"), + ("Face Model", "面部模型"), + ( + "Face tracking in the Tracker panel (Outline Only and Detailed Features) uses the model chosen here. Models are open source, downloaded only when you ask, and checked against their published SHA-256.", + "跟踪器面板中的面部跟踪(仅轮廓和详细五官)使用此处选择的模型。模型均为开源,仅在你请求时下载,并会根据其公布的 SHA-256 进行校验。", + ), + ("Match System", "跟随系统"), + ("Default", "默认"), + ("Stored, but not used by EffectCraft yet", "已保存,但 EffectCraft 尚未使用"), ]; const TRADITIONAL_CHINESE: &[(&str, &str)] = &[ @@ -1590,6 +1776,192 @@ const TRADITIONAL_CHINESE: &[(&str, &str)] = &[ ("After Effects project", "After Effects 專案"), ("Lottie animation", "Lottie 動畫"), ("Project", "專案"), + // Settings dialog pages (engine schema, #1178). + ("General", "一般"), + ("Language", "語言"), + ("Levels of Undo", "還原層級"), + ("Path Point and Handle Size", "路徑點和控點大小"), + ("Recent Projects Shown", "顯示的最近專案數"), + ("Options", "選項"), + ("Show Tool Tips", "顯示工具提示"), + ("Create Layers at Composition Start Time", "在合成開始時間建立圖層"), + ("Switches Affect Nested Comps", "開關影響巢狀合成"), + ("Default Spatial Interpolation to Linear", "預設空間插值為線性"), + ("Preserve Constant Vertex and Feather Point Count when Editing Masks", "編輯遮色片時保持固定的頂點和羽化點數"), + ("Synchronize Time of All Related Items", "同步所有相關項目的時間"), + ("Expression Pick Whip Writes Compact English", "運算式拾取線寫入精簡英文"), + ("Create Split Layers Above Original Layer", "在原始圖層上方建立分割圖層"), + ("Use System Color Picker", "使用系統檢色器"), + ( + "EffectCraft always uses its own colour picker (the same on every platform and the web).", + "EffectCraft 一律使用自己的檢色器(在所有平台和網頁版中皆相同)。", + ), + ("Startup & Repair", "啟動和修復"), + ("Show Home Screen When Launching", "啟動時顯示首頁畫面"), + ("Show Home Screen When Opening a Project", "開啟專案時顯示首頁畫面"), + ("Offer to Open the Latest Auto-Save After a Crash", "當機後提示開啟最新的自動儲存"), + ("Window Graphics", "視窗圖形"), + ("Automatic", "自動"), + ( + "Window Graphics applies from the next launch. When the graphics driver stops EffectCraft as its window opens, the next launch switches to OpenGL.", + "視窗圖形自下次啟動起生效。如果圖形驅動程式在視窗開啟時導致 EffectCraft 停止執行,下次啟動會切換為 OpenGL。", + ), + ("Repair", "修復"), + ("Reset Settings", "重設設定"), + ("Reset Keyboard Shortcuts", "重設鍵盤快速鍵"), + ("Empty Disk Cache", "清空磁碟快取"), + ("New Project Loads Template", "新增專案時載入範本"), + ("Template Project", "範本專案"), + ("Auto-Save", "自動儲存"), + ("Automatically Save Projects", "自動儲存專案"), + ("Save Every", "儲存間隔"), + ("Minutes", "分鐘"), + ("Maximum Project Versions", "專案版本數上限"), + ("Auto-Save Location", "自動儲存位置"), + ("Next to Project", "專案旁邊"), + ("Custom Location", "自訂位置"), + ("Save When Starting Render Queue", "啟動算圖佇列時儲存"), + ("Save Now", "立即儲存"), + ("Motion Path", "動態路徑"), + ("All Keyframes", "所有關鍵影格"), + ("No Motion Path", "無動態路徑"), + ("No More Than (Seconds)", "不超過(秒)"), + ("No More Than (Keyframes)", "不超過(關鍵影格)"), + ("Seconds", "秒"), + ("Keyframes", "關鍵影格"), + ("Display", "顯示"), + ("Show Rendering Progress in Info Panel and Flowchart", "在資訊面板和流程圖中顯示算圖進度"), + ("Hardware Accelerate Composition, Layer and Footage Panels", "硬體加速合成、圖層和素材面板"), + ("Panels are always drawn by the GPU (wgpu).", "面板一律由 GPU(wgpu)繪製。"), + ("Previews", "預覽"), + ("Adaptive Resolution Limit", "自適應解析度限制"), + ("Show Internal Wireframes", "顯示內部線框"), + ("Cache Frames When Idle", "閒置時快取影格"), + ("Viewer Zoom Quality", "檢視器縮放品質"), + ("Faster", "較快"), + ("More Accurate", "較精確"), + ("Display Color Space", "顯示色彩空間"), + ("GPU Information...", "GPU 資訊..."), + ("Appearance", "外觀"), + ("Brightness", "亮度"), + ("UI Scale", "介面縮放"), + ("Labels and Colors", "標籤和顏色"), + ("Use Label Color for Layer Handles and Paths", "將標籤顏色用於圖層控點和路徑"), + ("Use Label Color for Related Tabs", "將標籤顏色用於相關標籤頁"), + ("Cycle Mask Colors", "循環遮色片顏色"), + ("Use Gradients", "使用漸層"), + ("Menu Bar", "選單列"), + ("Grids & Guides", "格點和參考線"), + ("Gridline Every", "格點線間隔"), + ("Subdivisions", "細分"), + ("Style", "樣式"), + ("Lines", "線條"), + ("Dashed Lines", "虛線"), + ("Dots", "點"), + ("Horizontal", "水平"), + ("Vertical", "垂直"), + ("Safe Margins", "安全邊界"), + ("Action-safe", "動作安全"), + ("Title-safe", "字幕安全"), + ("Labels", "標籤"), + ("Text Engine", "文字引擎"), + ("Latin", "拉丁文"), + ("South Asian and Middle Eastern", "南亞和中東"), + ("Show Font Preview", "顯示字體預覽"), + ("Number of Recent Fonts to Display", "要顯示的最近使用字體數"), + ("Show Font Names in English", "以英文顯示字體名稱"), + ("Still Footage", "靜態素材"), + ("Length of Composition", "合成長度"), + ("Duration (Seconds)", "持續時間(秒)"), + ("Still Duration", "靜態持續時間"), + ("Sequence Footage", "序列素材"), + ("Report Missing Frames", "報告遺失的影格"), + ("Automatically Reload Footage", "自動重新載入素材"), + ("Off", "關閉"), + ("Non-Sequence Footage", "非序列素材"), + ("All Footage", "所有素材"), + ("Ask User", "詢問使用者"), + ("Guess", "猜測"), + ("Ignore", "忽略"), + ("Straight", "直接"), + ("Premultiplied", "預乘"), + ("Default Drag Import As", "預設拖曳匯入為"), + ("Footage", "素材"), + ("Composition - Retain Layer Sizes", "合成 - 保留圖層大小"), + ("Export", "匯出"), + ("Default Output Folder", "預設輸出資料夾"), + ("Segment Sequences", "分段序列"), + ("Files per Segment", "每段檔案數"), + ("files", "個檔案"), + ("Segment Movie Files", "分段影片檔案"), + ("Segment Size", "分段大小"), + ("Append Bit Depth to File Name", "將位元深度附加到檔案名稱"), + ("Audio", "音訊"), + ("Audio Hardware", "音訊硬體"), + ("Preview Sample Rate", "預覽取樣率"), + ("Audio Output Mapping", "音訊輸出對應"), + ("Left", "左"), + ("Right", "右"), + ("channel", "聲道"), + ("Disk", "磁碟"), + ("Disk Cache", "磁碟快取"), + ("Enable Disk Cache", "啟用磁碟快取"), + ("Maximum Disk Cache Size", "磁碟快取大小上限"), + ("Disk Cache Folder", "磁碟快取資料夾"), + ("Media Cache", "媒體快取"), + ("Database and Cache Folder", "資料庫和快取資料夾"), + ("Conformed Audio Folder", "符合的音訊資料夾"), + ("Memory & CPU", "記憶體和 CPU"), + ("RAM Reserved for Other Applications", "為其他應用程式保留的記憶體"), + ("Cache Budgets", "快取預算"), + ("Layer Cache", "圖層快取"), + ("Footage Frame Cache", "素材影格快取"), + ("Preview (RAM) Cache", "預覽(記憶體)快取"), + ("Reduce Cache Size When System Is Low on Memory", "系統記憶體不足時減少快取大小"), + ("Video", "視訊"), + ("Enable Video Preview Output", "啟用視訊預覽輸出"), + ("Video Device", "視訊裝置"), + ("Floating Window", "浮動視窗"), + ("Full Screen", "全螢幕"), + ("Video Output During Playback", "播放期間的視訊輸出"), + ("Mirror on Computer Monitor", "在電腦顯示器上鏡像"), + ("Disable Video Output When in Background", "在背景時停用視訊輸出"), + ("Default 3D Renderer", "預設 3D 算圖引擎"), + ("Show 3D Reference Axes", "顯示 3D 參考軸"), + ("Extended Viewer", "延伸檢視器"), + ("Realtime Shadows in Draft", "草稿模式下的即時陰影"), + ("Scripting & Expressions", "指令碼和運算式"), + ("Application Scripting", "應用程式指令碼"), + ("Allow Scripts to Write Files and Access Network", "允許指令碼寫入檔案和存取網路"), + ("Warn User When Executing Files", "執行檔案時警告使用者"), + ("Enable JavaScript Debugger", "啟用 JavaScript 除錯器"), + ("Expressions Editor", "運算式編輯器"), + ("Font Size", "字體大小"), + ("Syntax Highlighting", "語法醒目提示"), + ("Line Numbers", "行號"), + ("Auto-complete", "自動完成"), + ("Bracket Matching", "括號配對"), + ("Word Wrap", "自動換行"), + ("Show Expression Error Banner", "顯示運算式錯誤橫幅"), + ( + "Expressions use the JavaScript engine. Script errors report their file and line in the Script Console; there is no step debugger.", + "運算式使用 JavaScript 引擎。指令碼錯誤會在指令碼主控台中回報其檔案和行號;沒有逐步除錯器。", + ), + ("Roto Brush", "Roto 筆刷"), + ("Segmentation Model", "分割模型"), + ( + "Roto Brush 2.0 and 3.0 use the model chosen here (Version 1.0 always uses the classic engine). Models are open source, downloaded only when you ask, and checked against their published SHA-256.", + "Roto 筆刷 2.0 和 3.0 使用此處選擇的模型(1.0 版一律使用經典引擎)。模型皆為開放原始碼,僅在你要求時下載,並會依其公布的 SHA-256 進行驗證。", + ), + ("Face Tracking", "臉部追蹤"), + ("Face Model", "臉部模型"), + ( + "Face tracking in the Tracker panel (Outline Only and Detailed Features) uses the model chosen here. Models are open source, downloaded only when you ask, and checked against their published SHA-256.", + "追蹤器面板中的臉部追蹤(僅輪廓和詳細五官)使用此處選擇的模型。模型皆為開放原始碼,僅在你要求時下載,並會依其公布的 SHA-256 進行驗證。", + ), + ("Match System", "跟隨系統"), + ("Default", "預設"), + ("Stored, but not used by EffectCraft yet", "已儲存,但 EffectCraft 尚未使用"), ]; /// Ukrainian (uk): original translations of the same interface rows as the Chinese catalogs. @@ -3368,6 +3740,41 @@ mod tests { } } + /// The Settings pages come from the engine as data, so the literal scan above cannot see them: + /// every title, section, label, choice, button, note and unit they draw needs a Chinese row + /// (#1178). Language names are written in their own language, and a few labels read the same + /// everywhere. + #[test] + fn settings_pages_are_translated() { + use effectcraft_engine::prefs::{Item, Kind, LANGUAGES, pages}; + const VERBATIM: &[&str] = &["", "3D", "1/2", "1/4", "1/8", "sRGB", "Display P3", "px", "s", "%", "MB", "GB", "Hz", "pt"]; + let mut drawn = Vec::new(); + for page in pages() { + drawn.push(page.title); + for item in page.items { + match item { + Item::Section(text) | Item::Note(text) | Item::Button { label: text, .. } => drawn.push(text), + Item::Setting { label, kind, .. } => { + drawn.push(label); + match kind { + Kind::Int(_, _, unit) | Kind::Float(_, _, unit) => drawn.push(unit), + Kind::Choice(options) => drawn.extend(options.iter().map(|(l, _)| *l)), + _ => {} + } + } + _ => {} + } + } + } + drawn.push("Stored, but not used by EffectCraft yet"); + let languages: Vec<&str> = LANGUAGES.iter().map(|(l, _)| *l).filter(|l| *l != "Match System").collect(); + let hans: HashMap<&str, &str> = SIMPLIFIED_CHINESE.iter().copied().collect(); + let mut missing: Vec<&str> = drawn.into_iter().filter(|en| !VERBATIM.contains(en) && !languages.contains(en) && !hans.contains_key(en)).collect(); + missing.sort_unstable(); + missing.dedup(); + assert!(missing.is_empty(), "Settings text with no Simplified Chinese row: {missing:?}"); + } + /// A newly hard-coded interface string fails here instead of shipping in English to every /// language. It is a heuristic - it looks at the call shapes the panels use - and it ignores /// one-character literals, which are punctuation or a key name rather than a sentence. diff --git a/crates/ui-egui/src/panels/settings.rs b/crates/ui-egui/src/panels/settings.rs index f7a45feb..8cbb9b35 100644 --- a/crates/ui-egui/src/panels/settings.rs +++ b/crates/ui-egui/src/panels/settings.rs @@ -77,7 +77,7 @@ fn page_ui(app: &mut EffectcraftApp, ui: &mut egui::Ui, page: &Page, cur: &Value let sel = get(key).as_str().unwrap_or("").to_string(); ui.horizontal(|ui| { ui.add_sized(vec2(label_w, 18.0), egui::Label::new(tr("Default Output:"))); - let shown = if sel.is_empty() { "System Default".to_string() } else { sel.clone() }; + let shown = if sel.is_empty() { tr("System Default").to_string() } else { sel.clone() }; let r = egui::ComboBox::from_id_salt(("settings", key)).selected_text(shown).width(260.0).show_ui(ui, |ui| { if ui.selectable_label(sel.is_empty(), tr("System Default")).clicked() { acts.push(Act::Set(key.into(), json!(""))); @@ -101,7 +101,7 @@ fn page_ui(app: &mut EffectcraftApp, ui: &mut egui::Ui, page: &Page, cur: &Value Item::Setting { key, label, kind, live } => { let v = get(key); let id = format!("settings.{key}"); - let tip = (!live).then_some("Stored, but not used by EffectCraft yet"); + let tip = (!live).then(|| tr("Stored, but not used by EffectCraft yet")); let mut resp: Option = None; match kind { Kind::Bool => { @@ -123,7 +123,7 @@ fn page_ui(app: &mut EffectcraftApp, ui: &mut egui::Ui, page: &Page, cur: &Value let drag = egui::DragValue::new(&mut x).range(lo..=hi).speed(0.25).update_while_editing(false); let r = ui.add(crate::widgets::drag_value(drag)); if !unit.is_empty() { - ui.label(RichText::new(unit).color(t.text_dim)); + ui.label(RichText::new(tr(unit)).color(t.text_dim)); } if r.changed() { acts.push(Act::Set(key.into(), json!(x))); @@ -134,7 +134,7 @@ fn page_ui(app: &mut EffectcraftApp, ui: &mut egui::Ui, page: &Page, cur: &Value let mut x = v.as_f64().unwrap_or(0.0); let r = ui.add(crate::widgets::drag_value(egui::DragValue::new(&mut x).range(lo..=hi).speed(0.1).max_decimals(3))); if !unit.is_empty() { - ui.label(RichText::new(unit).color(t.text_dim)); + ui.label(RichText::new(tr(unit)).color(t.text_dim)); } if r.changed() { acts.push(Act::Set(key.into(), json!(x))); @@ -146,7 +146,7 @@ fn page_ui(app: &mut EffectcraftApp, ui: &mut egui::Ui, page: &Page, cur: &Value ui.label(RichText::new(tr("Darker")).color(t.text_dim)); let r = ui.add(egui::Slider::new(&mut x, lo..=hi).show_value(false)); ui.label(RichText::new(tr("Lighter")).color(t.text_dim)); - if ui.small_button("Default").clicked() { + if ui.small_button(tr("Default")).clicked() { acts.push(Act::Set(key.into(), json!(0.0))); } if r.changed() {