Skip to content

Filter the Command Palette in English in addition to locale #19166

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

DHowett
Copy link
Member

@DHowett DHowett commented Jul 23, 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.

image image

Refs #19130, #19131, #19132, #19165
Closes #7039

Comment on lines +20 to +25
static bool shouldShowSubtitles = [] {
auto ctx = winrt::Windows::ApplicationModel::Resources::Core::ResourceContext::GetForViewIndependentUse();
auto qv = ctx.QualifierValues();
auto lang = qv.TryLookup(L"language");
return lang != L"en-US";
}();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't love this

auto itemSubtitle = _Item.Subtitle();
int32_t subtitleWeight = 0;
std::tie(subtitleSegments, subtitleWeight) = _matchedSegmentsAndWeight(_pattern, itemSubtitle);
weight += subtitleWeight;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OPEN DISCUSSION (cc @e82eric) how do we combine weights when we have multiple haystacks

Copy link
Contributor

@e82eric e82eric Jul 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for the localization use case, looking at the screenshots, I would lean towards using the max of the 2 scores. I think where "split" gets matched in both the localized and English haystacks adding them would cause the items with English chars/matches in the localized version to score unfairly high compared to the ones that don't.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent excellent call. I've done this :)

@DHowett DHowett force-pushed the dev/duhowett/multi-lingual-command-palette branch from 703afff to 497b8f2 Compare July 23, 2025 23:16
@DHowett DHowett force-pushed the dev/duhowett/command-name-resource-or-string branch from 996b06c to e867912 Compare July 23, 2025 23:16
Base automatically changed from dev/duhowett/command-name-resource-or-string to main July 24, 2025 17:53
@DHowett DHowett marked this pull request as ready for review July 24, 2025 17:53
@DHowett DHowett force-pushed the dev/duhowett/multi-lingual-command-palette branch from df38587 to 38b9a7d Compare July 24, 2025 17:56
@microsoft-github-policy-service microsoft-github-policy-service bot added Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Area-CmdPal Command Palette issues and features Area-Localization Area-UserInterface Issues pertaining to the user interface of the Console or Terminal Priority-1 A description (P1) Product-Terminal The new Windows Terminal. labels Jul 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-CmdPal Command Palette issues and features Area-Localization Area-UserInterface Issues pertaining to the user interface of the Console or Terminal Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Priority-1 A description (P1) Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Don't localize command names on the command palette
2 participants