Repository navigation
Brushes: built-in library panels show brush names in the UI language - #7129
Merged
bflatastic merged 2 commits intoNov 13, 2026
Merged
Conversation
A built-in brush library's panel now shows each brush's name in the UI language in its list rows and tooltips, and Find matches either the shown name or the English name. User Defined and Other Library... libraries, and the document's Brushes panel, keep names as stored. A click, a drag, Add to Brushes and brush.addFromLibrary still use the English name, so the brush comes into the document under that name. The shared library panel gets a label hook for this, and its rows take the library id. The 16 built-in brush names that had no catalog row (Notched Ribbon, Double Line, Wave, Teardrop, Striped Ribbon, Fine Nib, Broad Nib, Chisel, Round Pen, Pressure Pen, Beads, Dash Dot, Scallops, Stars, Triangles, Sparkles) get a row in each of the 27 catalogs, and a test requires a row for every built-in brush name.
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 2 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Member
|
Merged, thanks @dotCooCoo! It passed its CI checks. |
3 of 4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
A built-in brush library's panel (Window › Brush Libraries) translated the library's title but listed its brushes by their English names in every UI language. Sixteen of the built-in brush names also had no row in any catalog: Notched Ribbon, Double Line, Wave, Teardrop, Striped Ribbon, Fine Nib, Broad Nib, Chisel, Round Pen, Pressure Pen, Beads, Dash Dot, Scallops, Stars, Triangles and Sparkles.
With this change, a built-in brush library's list rows, list tooltips and thumbnail tooltips show each brush's name in the UI language. Translating built-in brush names is VectorCraft's own rule:
LibraryKind(crates/ui-egui/src/panels/library_panel.rs) has a newlabel(id, name)hook that returns the name as it is by default, androwsnow takes the library id. The panel draws the label;Row.namekeeps the stored name for the tile, selection, clicks, drags, Add to Brushes andbrush.addFromLibrary, so a brush still comes into the document under its English name.BrushLibraries::label(crates/ui-egui/src/panels/brushes.rs) translates a name only when the library id is one ofbrushlib::BUILTIN. Brushes in User Defined and Other Library… libraries, and the document's Brushes panel, show names as they are stored.rowstake the id unused.docs/target-app-parity.mdhas one line for the rule.The change alters existing behavior: in a UI language other than English, built-in brush library panels now list translated names instead of English ones.
How it was tested
New tests in
vectorcraft-ui-egui:i18n::tests::built_in_library_brush_names_are_in_complete_catalogs: every one of the 43 distinct brush names in the built-in libraries has a row in each complete catalog.panels::tests_brush_libraries::built_in_library_brushes_are_listed_in_the_ui_language: in French, the Ink and Wash panel lists "Encre effilée" and not "Tapered Ink"; Find matches both "effil" and "tapered"; a library id outside the built-in set does not match the translation; a click adds "Tapered Ink" to the document and makes it the current brush; the document opened with Other Library… lists "Tapered Ink" unchanged. WithBrushLibraries::labelreturning the stored name, it fails at its first list assertion.Five existing tests pass the library id to
rowsat six call sites: two intests_brush_libraries.rs, two intests_style_libraries.rs, one intests_symbol_libraries.rsand one inpanels/library_panel/tests.rs.Focused checks on the final tree, on Linux. The branch is one commit on
mainat1dbdbce91fand merges cleanly with it. It conflicts with open #5439 indocs/target-app-parity.md.cargo fmt --all -- --checkcargo clippy -p vectorcraft-ui-egui --all-targets -- -D warningscargo check --workspace --testscargo test -p vectorcraft-ui-egui --lib i18n: 102 passed, 0 failed.cargo test -p vectorcraft-ui-egui --libfor the brush, graphic style and symbol library tests andpanels::library_panel::tests: 38 passed, 0 failed.cargo xtask brands,cargo xtask layers(30 crates) andcargo xtask assets(337 files).cargo xtask ciruns in this pull request's CI.Checklist
cargo xtask cipasses (fmt, clippy, tests, assets, brands, layers, wasm).unwrap(),expect(),panic!,unreachable!,todo!orunimplemented!outside tests, and no unchecked indexing on data from files, parameters ormessages. Errors are returned as
Resultand shown to the user(why and how).
ASSETS.md.