-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
base: main
Are you sure you want to change the base?
Conversation
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"; | ||
}(); |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 :)
703afff
to
497b8f2
Compare
996b06c
to
e867912
Compare
df38587
to
38b9a7d
Compare
The bulk of this work is changing
Command::Name
(and its descendants likeGenerateName
) to support looking up names in English and in the local language.Refs #19130, #19131, #19132, #19165
Closes #7039