~100 hardcoded user-facing strings in wgpui-component UI components
#481 opened on Jul 29, 2026
Repository metrics
- Stars
- (348 stars)
- PR merge metrics
- (PR metrics pending)
Description
Summary
The shared UI component crate (crates/ui/wgpui-component/crates/ui/src/) contains ~100+ hardcoded English strings that use format!(...) directly instead of going through t!(). These strings are user-facing and should be translatable.
Files and strings
profiler.rs (~70 strings) — the largest concentration:
- Counter tile labels:
"FPS","Mean Frame","Max Frame","Present Mode","Frames Captured","Full-draw Frames","Fast-path Frames","Atlas Hit Rate" - Flame lane labels:
"Main Thread (CPU)","GPU",format!("Background Thread {}", index + 1) - Section headings:
"Draw Calls & Primitives","CPU/GPU Submit Timeline","CPU Memory","GPU Memory","Live Preview","Node Details" - Draw call table:
"Quads","Shadows","Mono Sprites","Poly Sprites","Paths","Underlines","Backdrop Filters","Surfaces" - Button labels:
"Start Capture"/"Stop Capture","Capture Frame","Refresh Snapshot","Capture UI Tree" - DescriptionList labels:
"Duration","Depth","Lane","Category","Element","Source","Type","Display","Visibility","Background","Text Color", etc. - Memory section:
"Element Arena","Glyph Cache","Shaped Line Cache","Image Cache","Capture Engine" - GPU memory:
"Fixed Buffers","Atlas Textures","Surface Registry","Swapchain"
inspector.rs (~20 strings):
"Inspector","Rust Styles","JSON Styles","Box Model","Reset"- Layout labels:
"Width","Height","X","Y","Margin","Border","Padding","Content" - Empty states:
"No elements available.","Select an element to view its styles.", etc.
download_item.rs: "Downloading", "Done", "Error", "Complete", "Open Folder", format!("ETA {}", eta)
download_manager.rs: format!("Downloads — {} active", ...), "No downloads yet", "Downloads"
code_editor.rs: format!("Ln {line}, Col {col}"), format!("{total_lines} lines"), "UTF-8"
color_picker/picker.rs: Channel labels "R", "G", "B", "A", harmony names "Complementary", "Analogous", "Triadic", section headings "All Colors", "Color Relations", "Recent", "Code", format!("Palette: {}")
hierarchical_list_view.rs: format!("{} objects", ...)
replication.rs: format!("Locked by {}", ...), format!("+{}", ...)
Suggested fix
For each string, replace with t!("Key.Name") and add the key to the crate's locales/en.yml (which currently does not exist — see #478). For format!() with dynamic values, use rust_i18n named parameter syntax: t!("Key.Name", count => value).