Enable search for Windows shortcuts using both localized and English names

Co-authored-by: VictoriousRaptor <10308169+VictoriousRaptor@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-01-01 10:37:29 +00:00
parent c2ab601abb
commit b25f9e8366

View file

@ -112,12 +112,34 @@ namespace Flow.Launcher.Plugin.Program.Programs
{
title = resultName;
matchResult = Main.Context.API.FuzzySearch(query, resultName);
// When there's a localized name, also search the original English name
// This allows users to search using either the localized name or the English filename
if (useLocalizedName)
{
var englishNameMatch = Main.Context.API.FuzzySearch(query, Name);
if (englishNameMatch.Score > matchResult.Score)
{
matchResult = englishNameMatch;
}
}
}
else
{
// Search in both
title = $"{resultName}: {Description}";
var nameMatch = Main.Context.API.FuzzySearch(query, resultName);
// When there's a localized name, also search the original English name
if (useLocalizedName)
{
var englishNameMatch = Main.Context.API.FuzzySearch(query, Name);
if (englishNameMatch.Score > nameMatch.Score)
{
nameMatch = englishNameMatch;
}
}
var descriptionMatch = Main.Context.API.FuzzySearch(query, Description);
if (descriptionMatch.Score > nameMatch.Score)
{
@ -143,11 +165,6 @@ namespace Flow.Launcher.Plugin.Program.Programs
candidates.Add(ExecutableName);
}
if (useLocalizedName)
{
candidates.Add(Name);
}
matchResult = Match(query, candidates);
if (matchResult == null)
{