Skip to content

Expose a library's Resource Loader, allow a user to "subset" it#19131

Merged
DHowett merged 4 commits intomainfrom
dev/duhowett/expose-srl-withqualifier
Jul 14, 2025
Merged

Expose a library's Resource Loader, allow a user to "subset" it#19131
DHowett merged 4 commits intomainfrom
dev/duhowett/expose-srl-withqualifier

Conversation

@DHowett
Copy link
Member

@DHowett DHowett commented Jul 14, 2025

This pull request elevates ScopedResourceLoader to the API surface of LibraryResources, which will allow any library resource consumer to directly interact with its resource loader.

One of those new interactions is to make a sub-context with a specific narrowed-down qualifier. Like this:

auto englishOnlyLoader = GetLibraryResourceLoader().WithQualifier(L"language", L"en-us");
/* auto foo = */ englishOnlyLoader.GetLocalizedString(USES_RESOURCE(L"AppName"));

@DHowett DHowett changed the title resources: Expose a library's Resource Loader, and allow a holder to "subset" it Expose a library's Resource Loader, allow a user to "subset" it Jul 14, 2025
@DHowett DHowett enabled auto-merge (squash) July 14, 2025 22:14
@DHowett
Copy link
Member Author

DHowett commented Jul 14, 2025

the downside is that this does allow people to circumvent the resource protections, but... on the whole, we should trust ourselves not to mess it up :P

@DHowett DHowett merged commit bdf4432 into main Jul 14, 2025
17 of 19 checks passed
@DHowett DHowett deleted the dev/duhowett/expose-srl-withqualifier branch July 14, 2025 22:43
DHowett added a commit that referenced this pull request Jul 28, 2025
The bulk of this work is changing `Command::Name` (and its descendants
like `GenerateName`) to support looking up names in English and in the
local language.

When matching a "palette item" with a "subtitle" (a new field introduced
to store the English command name when the current language is not
English), the weight of the subtitle is used only if it is greater than
the weight of the name. This ensures that we do not penalize or
over-promote results that contain similar Latin letters in both fields.

Refs #19130, #19131, #19132, #19165
Closes #7039
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants