wgpui-component (ui) crate has rust_i18n initialized but no locale files
#478 opened on Jul 29, 2026
Repository metrics
- Stars
- (348 stars)
- PR merge metrics
- (PR metrics pending)
Description
Summary
The crates/ui/wgpui-component/crates/ui/src/lib.rs:179 crate calls rust_i18n::i18n!("locales", fallback = "en") but no locales/ directory exists anywhere under crates/ui/wgpui-component/crates/ui/. This means every t!() call within this crate resolves to raw key names instead of translated text.
Impact
All t!() usages across the shared UI component library show untranslated keys to users:
| Key | Used in | File |
|---|---|---|
Dropdown.placeholder |
dropdown.rs, dropdown/base.rs |
Multiple places |
Modal.ok / Modal.cancel |
modal.rs |
Lines 299, 329 |
Dock.* (Unnamed, Close, Zoom, Collapse, Expand) |
dock/panel.rs, dock/tab_panel/render.rs |
Multiple |
Calendar.* |
time/calendar.rs |
All month/week labels |
DatePicker.* |
time/date_picker.rs |
Placeholder |
Input.* (Replace, Replace All, Cut, Copy, Paste, Select All) |
input/search.rs |
Lines 548, 557 |
List.search_placeholder |
list/list.rs |
Search placeholder |
Additionally, window_wrapper.rs:27 uses crate::translate() with keys like "Window.Title.FileManager" that are only defined in ui_common/locales/en.yml — a different crate's locale scope. These will also fail to resolve.
Reproduction
Try switching the editor to any non-English locale — all shared UI components (dock panels, dropdowns, modals, calendars, search bars) will display raw key names instead of translations.
Suggested fix
- Create
locales/directory incrates/ui/wgpui-component/crates/ui/ - Add
en.ymlcontaining all keys used byt!()calls in this crate (can extract fromui_common/locales/en.ymlfor the shared keys, plus crate-specific keys) - Either copy the keys to each locale file that
ui_commonsupports, or establish a shared locale mechanism
See also: #58 (tabs and panel titles — partially overlaps)