Merge branch 'dev' into enable_windows_key

This commit is contained in:
Jeremy Wu 2025-01-27 15:49:48 +11:00 committed by GitHub
commit 068b77421b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 256 additions and 188 deletions

View file

@ -54,7 +54,7 @@
<ItemGroup>
<PackageReference Include="Droplex" Version="1.7.0" />
<PackageReference Include="FSharp.Core" Version="9.0.100" />
<PackageReference Include="FSharp.Core" Version="9.0.101" />
<PackageReference Include="Meziantou.Framework.Win32.Jobs" Version="3.4.0" />
<PackageReference Include="Microsoft.IO.RecyclableMemoryStream" Version="3.0.1" />
<PackageReference Include="squirrel.windows" Version="1.5.2" NoWarn="NU1701" />

View file

@ -26,54 +26,33 @@ namespace Flow.Launcher.Core.Plugin
protected override async Task<bool> ExecuteResultAsync(JsonRPCResult result)
{
try
{
var res = await RPC.InvokeAsync<JsonRPCExecuteResponse>(result.JsonRPCAction.Method,
argument: result.JsonRPCAction.Parameters);
var res = await RPC.InvokeAsync<JsonRPCExecuteResponse>(result.JsonRPCAction.Method,
argument: result.JsonRPCAction.Parameters);
return res.Hide;
}
catch
{
return false;
}
return res.Hide;
}
private JoinableTaskFactory JTF { get; } = new JoinableTaskFactory(new JoinableTaskContext());
public override List<Result> LoadContextMenus(Result selectedResult)
{
try
{
var res = JTF.Run(() => RPC.InvokeWithCancellationAsync<JsonRPCQueryResponseModel>("context_menu",
new object[] { selectedResult.ContextData }));
var res = JTF.Run(() => RPC.InvokeWithCancellationAsync<JsonRPCQueryResponseModel>("context_menu",
new object[] { selectedResult.ContextData }));
var results = ParseResults(res);
var results = ParseResults(res);
return results;
}
catch
{
return new List<Result>();
}
return results;
}
public override async Task<List<Result>> QueryAsync(Query query, CancellationToken token)
{
try
{
var res = await RPC.InvokeWithCancellationAsync<JsonRPCQueryResponseModel>("query",
new object[] { query, Settings.Inner },
token);
var res = await RPC.InvokeWithCancellationAsync<JsonRPCQueryResponseModel>("query",
new object[] { query, Settings.Inner },
token);
var results = ParseResults(res);
var results = ParseResults(res);
return results;
}
catch
{
return new List<Result>();
}
return results;
}

View file

@ -30,7 +30,6 @@ namespace Flow.Launcher.Core.Resource
public static Language Vietnamese = new Language("vi-vn", "Tiếng Việt");
public static Language Hebrew = new Language("he", "עברית");
public static List<Language> GetAvailableLanguages()
{
List<Language> languages = new List<Language>
@ -63,5 +62,38 @@ namespace Flow.Launcher.Core.Resource
};
return languages;
}
public static string GetSystemTranslation(string languageCode)
{
return languageCode switch
{
"en" => "System",
"zh-cn" => "系统",
"zh-tw" => "系統",
"uk-UA" => "Система",
"ru" => "Система",
"fr" => "Système",
"ja" => "システム",
"nl" => "Systeem",
"pl" => "System",
"da" => "System",
"de" => "System",
"ko" => "시스템",
"sr" => "Систем",
"pt-pt" => "Sistema",
"pt-br" => "Sistema",
"es" => "Sistema",
"es-419" => "Sistema",
"it" => "Sistema",
"nb-NO" => "System",
"sk" => "Systém",
"tr" => "Sistem",
"cs" => "Systém",
"ar" => "النظام",
"vi-vn" => "Hệ thống",
"he" => "מערכת",
_ => "System",
};
}
}
}

View file

@ -18,23 +18,52 @@ namespace Flow.Launcher.Core.Resource
{
public Settings Settings { get; set; }
private const string Folder = "Languages";
private const string DefaultLanguageCode = "en";
private const string DefaultFile = "en.xaml";
private const string Extension = ".xaml";
private readonly List<string> _languageDirectories = new List<string>();
private readonly List<ResourceDictionary> _oldResources = new List<ResourceDictionary>();
private readonly string SystemLanguageCode;
public Internationalization()
{
AddFlowLauncherLanguageDirectory();
SystemLanguageCode = GetSystemLanguageCodeAtStartup();
}
private void AddFlowLauncherLanguageDirectory()
{
var directory = Path.Combine(Constant.ProgramDirectory, Folder);
_languageDirectories.Add(directory);
}
private static string GetSystemLanguageCodeAtStartup()
{
var availableLanguages = AvailableLanguages.GetAvailableLanguages();
// Retrieve the language identifiers for the current culture.
// ChangeLanguage method overrides the CultureInfo.CurrentCulture, so this needs to
// be called at startup in order to get the correct lang code of system.
var currentCulture = CultureInfo.CurrentCulture;
var twoLetterCode = currentCulture.TwoLetterISOLanguageName;
var threeLetterCode = currentCulture.ThreeLetterISOLanguageName;
var fullName = currentCulture.Name;
// Try to find a match in the available languages list
foreach (var language in availableLanguages)
{
var languageCode = language.LanguageCode;
if (string.Equals(languageCode, twoLetterCode, StringComparison.OrdinalIgnoreCase) ||
string.Equals(languageCode, threeLetterCode, StringComparison.OrdinalIgnoreCase) ||
string.Equals(languageCode, fullName, StringComparison.OrdinalIgnoreCase))
{
return languageCode;
}
}
return DefaultLanguageCode;
}
internal void AddPluginLanguageDirectories(IEnumerable<PluginPair> plugins)
{
@ -68,8 +97,18 @@ namespace Flow.Launcher.Core.Resource
public void ChangeLanguage(string languageCode)
{
languageCode = languageCode.NonNull();
Language language = GetLanguageByLanguageCode(languageCode);
ChangeLanguage(language);
// Get actual language if language code is system
var isSystem = false;
if (languageCode == Constant.SystemLanguageCode)
{
languageCode = SystemLanguageCode;
isSystem = true;
}
// Get language by language code and change language
var language = GetLanguageByLanguageCode(languageCode);
ChangeLanguage(language, isSystem);
}
private Language GetLanguageByLanguageCode(string languageCode)
@ -87,11 +126,10 @@ namespace Flow.Launcher.Core.Resource
}
}
public void ChangeLanguage(Language language)
private void ChangeLanguage(Language language, bool isSystem)
{
language = language.NonNull();
RemoveOldLanguageFiles();
if (language != AvailableLanguages.English)
{
@ -103,7 +141,7 @@ namespace Flow.Launcher.Core.Resource
CultureInfo.CurrentUICulture = CultureInfo.CurrentCulture;
// Raise event after culture is set
Settings.Language = language.LanguageCode;
Settings.Language = isSystem ? Constant.SystemLanguageCode : language.LanguageCode;
_ = Task.Run(() =>
{
UpdatePluginMetadataTranslations();
@ -167,7 +205,9 @@ namespace Flow.Launcher.Core.Resource
public List<Language> LoadAvailableLanguages()
{
return AvailableLanguages.GetAvailableLanguages();
var list = AvailableLanguages.GetAvailableLanguages();
list.Insert(0, new Language(Constant.SystemLanguageCode, AvailableLanguages.GetSystemTranslation(SystemLanguageCode)));
return list;
}
public string GetTranslation(string key)

View file

@ -52,5 +52,7 @@ namespace Flow.Launcher.Infrastructure
public const string SponsorPage = "https://github.com/sponsors/Flow-Launcher";
public const string GitHub = "https://github.com/Flow-Launcher/Flow.Launcher";
public const string Docs = "https://flowlauncher.com/docs";
public const string SystemLanguageCode = "system";
}
}

View file

@ -68,7 +68,7 @@ namespace Flow.Launcher.Infrastructure
var numRemaining = hWnds.Count;
PInvoke.EnumWindows((wnd, _) =>
{
var searchIndex = hWnds.FindIndex(x => x.HWND == wnd.Value);
var searchIndex = hWnds.FindIndex(x => new IntPtr(x.HWND) == wnd);
if (searchIndex != -1)
{
z[searchIndex] = index;

View file

@ -53,7 +53,7 @@
<ItemGroup>
<PackageReference Include="Ben.Demystifier" Version="0.4.1" />
<PackageReference Include="BitFaster.Caching" Version="2.5.2" />
<PackageReference Include="BitFaster.Caching" Version="2.5.3" />
<PackageReference Include="Fody" Version="6.5.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

View file

@ -13,7 +13,7 @@ namespace Flow.Launcher.Infrastructure.UserSettings
{
public class Settings : BaseModel, IHotkeySettings
{
private string language = "en";
private string language = Constant.SystemLanguageCode;
private string _theme = Constant.DefaultTheme;
public string Hotkey { get; set; } = $"{KeyConstant.LeftAlt} + {KeyConstant.Space}";
public string OpenResultModifiers { get; set; } = KeyConstant.Alt;

View file

@ -157,27 +157,6 @@ namespace Flow.Launcher.Plugin
}
}
/// <inheritdoc />
public override bool Equals(object obj)
{
var r = obj as Result;
var equality = string.Equals(r?.Title, Title) &&
string.Equals(r?.SubTitle, SubTitle) &&
string.Equals(r?.AutoCompleteText, AutoCompleteText) &&
string.Equals(r?.CopyText, CopyText) &&
string.Equals(r?.IcoPath, IcoPath) &&
TitleHighlightData == r.TitleHighlightData;
return equality;
}
/// <inheritdoc />
public override int GetHashCode()
{
return HashCode.Combine(Title, SubTitle, AutoCompleteText, CopyText, IcoPath);
}
/// <inheritdoc />
public override string ToString()
{

View file

@ -63,28 +63,5 @@ namespace Flow.Launcher.Test.Plugins
})
};
[TestCaseSource(typeof(JsonRPCPluginTest), nameof(ResponseModelsSource))]
public async Task GivenModel_WhenSerializeWithDifferentNamingPolicy_ThenExpectSameResult_Async(JsonRPCQueryResponseModel reference)
{
var camelText = JsonSerializer.Serialize(reference, new JsonSerializerOptions() { PropertyNamingPolicy = JsonNamingPolicy.CamelCase });
var pascalText = JsonSerializer.Serialize(reference);
var results1 = await QueryAsync(new Query { Search = camelText }, default);
var results2 = await QueryAsync(new Query { Search = pascalText }, default);
Assert.IsNotNull(results1);
Assert.IsNotNull(results2);
foreach (var ((result1, result2), referenceResult) in results1.Zip(results2).Zip(reference.Result))
{
Assert.AreEqual(result1, result2);
Assert.AreEqual(result1, referenceResult);
Assert.IsNotNull(result1);
Assert.IsNotNull(result1.AsyncAction);
}
}
}
}

View file

@ -99,7 +99,7 @@
<!-- https://github.com/Flow-Launcher/Flow.Launcher/issues/1772#issuecomment-1502440801 -->
<PackageReference Include="ModernWpfUI" Version="0.9.4" />
<PackageReference Include="PropertyChanged.Fody" Version="3.4.0" />
<PackageReference Include="SemanticVersioning" Version="3.0.0-beta2" />
<PackageReference Include="SemanticVersioning" Version="3.0.0" />
<PackageReference Include="VirtualizingWrapPanel" Version="2.1.0" />
</ItemGroup>

View file

@ -10,16 +10,29 @@ public static class SingletonWindowOpener
{
var window = Application.Current.Windows.OfType<Window>().FirstOrDefault(x => x.GetType() == typeof(T))
?? (T)Activator.CreateInstance(typeof(T), args);
// Fix UI bug
// Add `window.WindowState = WindowState.Normal`
// If only use `window.Show()`, Settings-window doesn't show when minimized in taskbar
// Not sure why this works tho
// Probably because, when `.Show()` fails, `window.WindowState == Minimized` (not `Normal`)
// https://stackoverflow.com/a/59719760/4230390
window.WindowState = WindowState.Normal;
window.Show();
// Ensure the window is not minimized before showing it
if (window.WindowState == WindowState.Minimized)
{
window.WindowState = WindowState.Normal;
}
// Ensure the window is visible
if (!window.IsVisible)
{
window.Show();
}
else
{
window.Activate(); // Bring the window to the foreground if already open
}
window.Focus();
return (T)window;

View file

@ -65,8 +65,8 @@
<system:String x:Key="LastQueryPreserved">Letzte Abfrage beibehalten</system:String>
<system:String x:Key="LastQuerySelected">Letzte Abfrage auswählen</system:String>
<system:String x:Key="LastQueryEmpty">Letzte Abfrage leeren</system:String>
<system:String x:Key="LastQueryActionKeywordPreserved">Preserve Last Action Keyword</system:String>
<system:String x:Key="LastQueryActionKeywordSelected">Select Last Action Keyword</system:String>
<system:String x:Key="LastQueryActionKeywordPreserved">Letztes Aktions-Schlüsselwort beibehalten</system:String>
<system:String x:Key="LastQueryActionKeywordSelected">Letztes Aktions-Schlüsselwort auswählen</system:String>
<system:String x:Key="KeepMaxResults">Feste Fensterhöhe</system:String>
<system:String x:Key="KeepMaxResultsToolTip">Die Fensterhöhe ist durch Ziehen nicht anpassbar.</system:String>
<system:String x:Key="maxShowResults">Maximal gezeigte Ergebnisse</system:String>

View file

@ -65,8 +65,8 @@
<system:String x:Key="LastQueryPreserved">Mantener la última consulta</system:String>
<system:String x:Key="LastQuerySelected">Seleccionar la última consulta</system:String>
<system:String x:Key="LastQueryEmpty">Limpiar la última consulta</system:String>
<system:String x:Key="LastQueryActionKeywordPreserved">Conservar palabra clave de última acción</system:String>
<system:String x:Key="LastQueryActionKeywordSelected">Seleccionar palabra clave de última acción</system:String>
<system:String x:Key="LastQueryActionKeywordPreserved">Conservar última palabra clave de acción</system:String>
<system:String x:Key="LastQueryActionKeywordSelected">Seleccionar última palabra clave de acción</system:String>
<system:String x:Key="KeepMaxResults">Altura de la ventana fija</system:String>
<system:String x:Key="KeepMaxResultsToolTip">La altura de la ventana no se puede ajustar arrastrando el ratón.</system:String>
<system:String x:Key="maxShowResults">Número máximo de resultados mostrados</system:String>

View file

@ -9,7 +9,7 @@
<system:String x:Key="runtimePluginChooseRuntimeExecutable">אנא בחר את קובץ ההפעלה {0}</system:String>
<system:String x:Key="runtimePluginUnableToSetExecutablePath">לא ניתן להגדיר נתיב הפעלה {0}, אנא נסה שוב בהגדרות Flow (גלול עד למטה).</system:String>
<system:String x:Key="failedToInitializePluginsTitle">נכשל בהפעלת תוספים</system:String>
<system:String x:Key="failedToInitializePluginsMessage">תוספים: {0} - נכשלים בטעינה ויהיו מושבתים, אנא צור קשר עם יוצרי התוספים לקבלת עזרה</system:String>
<system:String x:Key="failedToInitializePluginsMessage">תוספים: {0} - נכשלו בטעינה ויושבתו, אנא צור קשר עם יוצרי התוספים לקבלת עזרה</system:String>
<!-- MainWindow -->
<system:String x:Key="registerHotkeyFailed">רישום מקש הקיצור &quot;{0}&quot; נכשל. ייתכן שמקש הקיצור נמצא בשימוש על ידי תוכנה אחרת. שנה למקש קיצור אחר, או צא מהתוכנה האחרת.</system:String>
@ -54,10 +54,10 @@
<system:String x:Key="SearchWindowScreenPrimary">צג ראשי</system:String>
<system:String x:Key="SearchWindowScreenCustom">צג מותאם אישית</system:String>
<system:String x:Key="SearchWindowAlign">Search Window Position on Monitor</system:String>
<system:String x:Key="SearchWindowAlignCenter">Center</system:String>
<system:String x:Key="SearchWindowAlignCenterTop">Center Top</system:String>
<system:String x:Key="SearchWindowAlignLeftTop">Left Top</system:String>
<system:String x:Key="SearchWindowAlignRightTop">Right Top</system:String>
<system:String x:Key="SearchWindowAlignCenter">מרכז</system:String>
<system:String x:Key="SearchWindowAlignCenterTop">מרכז עליון</system:String>
<system:String x:Key="SearchWindowAlignLeftTop">שמאל עליון</system:String>
<system:String x:Key="SearchWindowAlignRightTop">ימין עליון</system:String>
<system:String x:Key="SearchWindowAlignCustom">Custom Position</system:String>
<system:String x:Key="language">שפה</system:String>
<system:String x:Key="lastQueryMode">Last Query Style</system:String>
@ -83,16 +83,16 @@
<system:String x:Key="selectPythonExecutable">Please select pythonw.exe</system:String>
<system:String x:Key="typingStartEn">Always Start Typing in English Mode</system:String>
<system:String x:Key="typingStartEnTooltip">Temporarily change your input method to English mode when activating Flow.</system:String>
<system:String x:Key="autoUpdates">Auto Update</system:String>
<system:String x:Key="select">Select</system:String>
<system:String x:Key="autoUpdates">עדכון אוטומטי</system:String>
<system:String x:Key="select">בחר</system:String>
<system:String x:Key="hideOnStartup">Hide Flow Launcher on startup</system:String>
<system:String x:Key="hideOnStartupToolTip">Flow Launcher search window is hidden in the tray after starting up.</system:String>
<system:String x:Key="hideNotifyIcon">Hide tray icon</system:String>
<system:String x:Key="hideNotifyIconToolTip">When the icon is hidden from the tray, the Settings menu can be opened by right-clicking on the search window.</system:String>
<system:String x:Key="querySearchPrecision">Query Search Precision</system:String>
<system:String x:Key="querySearchPrecisionToolTip">Changes minimum match score required for results.</system:String>
<system:String x:Key="SearchPrecisionNone">None</system:String>
<system:String x:Key="SearchPrecisionLow">Low</system:String>
<system:String x:Key="SearchPrecisionNone">ללא</system:String>
<system:String x:Key="SearchPrecisionLow">נמוך</system:String>
<system:String x:Key="SearchPrecisionRegular">Regular</system:String>
<system:String x:Key="ShouldUsePinyin">Search with Pinyin</system:String>
<system:String x:Key="ShouldUsePinyinToolTip">Allows using Pinyin to search. Pinyin is the standard system of romanized spelling for translating Chinese.</system:String>
@ -120,26 +120,26 @@
<system:String x:Key="priority">Priority</system:String>
<system:String x:Key="priorityToolTip">Change Plugin Results Priority</system:String>
<system:String x:Key="pluginDirectory">Plugin Directory</system:String>
<system:String x:Key="author">by</system:String>
<system:String x:Key="author">מאת</system:String>
<system:String x:Key="plugin_init_time">Init time:</system:String>
<system:String x:Key="plugin_query_time">Query time:</system:String>
<system:String x:Key="plugin_query_version">Version</system:String>
<system:String x:Key="plugin_query_web">Website</system:String>
<system:String x:Key="plugin_uninstall">Uninstall</system:String>
<system:String x:Key="plugin_query_version">גרסה</system:String>
<system:String x:Key="plugin_query_web">אתר</system:String>
<system:String x:Key="plugin_uninstall">הסר התקנה</system:String>
<!-- Setting Plugin Store -->
<system:String x:Key="pluginStore">חנות תוספים</system:String>
<system:String x:Key="pluginStore_NewRelease">New Release</system:String>
<system:String x:Key="pluginStore_NewRelease">שחרור חדש</system:String>
<system:String x:Key="pluginStore_RecentlyUpdated">Recently Updated</system:String>
<system:String x:Key="pluginStore_None">תוספים</system:String>
<system:String x:Key="pluginStore_Installed">Installed</system:String>
<system:String x:Key="pluginStore_Installed">מותקן</system:String>
<system:String x:Key="refresh">רענן</system:String>
<system:String x:Key="installbtn">התקן</system:String>
<system:String x:Key="uninstallbtn">Uninstall</system:String>
<system:String x:Key="uninstallbtn">הסר התקנה</system:String>
<system:String x:Key="updatebtn">עדכון</system:String>
<system:String x:Key="LabelInstalledToolTip">Plugin already installed</system:String>
<system:String x:Key="LabelNew">New Version</system:String>
<system:String x:Key="LabelNew">גרסה חדשה</system:String>
<system:String x:Key="LabelNewToolTip">This plugin has been updated within the last 7 days</system:String>
<system:String x:Key="LabelUpdateToolTip">New Update is Available</system:String>
@ -164,7 +164,7 @@
<system:String x:Key="queryBoxFont">Query Box Font</system:String>
<system:String x:Key="resultItemFont">Result Title Font</system:String>
<system:String x:Key="resultSubItemFont">Result Subtitle Font</system:String>
<system:String x:Key="resetCustomize">Reset</system:String>
<system:String x:Key="resetCustomize">אפס</system:String>
<system:String x:Key="CustomizeToolTip">Customize</system:String>
<system:String x:Key="windowMode">Window Mode</system:String>
<system:String x:Key="opacity">Opacity</system:String>
@ -196,9 +196,9 @@
<!-- Setting Hotkey -->
<system:String x:Key="hotkey">Hotkey</system:String>
<system:String x:Key="hotkeys">Hotkeys</system:String>
<system:String x:Key="flowlauncherHotkey">Open Flow Launcher</system:String>
<system:String x:Key="hotkey">מקש קיצור</system:String>
<system:String x:Key="hotkeys">מקשי קיצור</system:String>
<system:String x:Key="flowlauncherHotkey">פתח את Flow Launcher</system:String>
<system:String x:Key="flowlauncherHotkeyToolTip">Enter shortcut to show/hide Flow Launcher.</system:String>
<system:String x:Key="previewHotkey">Toggle Preview</system:String>
<system:String x:Key="previewHotkeyToolTip">Enter shortcut to show/hide preview in search window.</system:String>
@ -206,24 +206,24 @@
<system:String x:Key="hotkeyPresetsToolTip">List of currently registered hotkeys</system:String>
<system:String x:Key="openResultModifiers">Open Result Modifier Key</system:String>
<system:String x:Key="openResultModifiersToolTip">Select a modifier key to open selected result via keyboard.</system:String>
<system:String x:Key="showOpenResultHotkey">Show Hotkey</system:String>
<system:String x:Key="showOpenResultHotkey">הצג מקש קיצור</system:String>
<system:String x:Key="showOpenResultHotkeyToolTip">Show result selection hotkey with results.</system:String>
<system:String x:Key="autoCompleteHotkey">Auto Complete</system:String>
<system:String x:Key="autoCompleteHotkeyToolTip">Runs autocomplete for the selected items.</system:String>
<system:String x:Key="SelectNextItemHotkey">Select Next Item</system:String>
<system:String x:Key="SelectPrevItemHotkey">Select Previous Item</system:String>
<system:String x:Key="SelectNextPageHotkey">Next Page</system:String>
<system:String x:Key="SelectPrevPageHotkey">Previous Page</system:String>
<system:String x:Key="SelectNextPageHotkey">הדף הבא</system:String>
<system:String x:Key="SelectPrevPageHotkey">הדף הקודם</system:String>
<system:String x:Key="CycleHistoryUpHotkey">Cycle Previous Query</system:String>
<system:String x:Key="CycleHistoryDownHotkey">Cycle Next Query</system:String>
<system:String x:Key="OpenContextMenuHotkey">Open Context Menu</system:String>
<system:String x:Key="OpenNativeContextMenuHotkey">Open Native Context Menu</system:String>
<system:String x:Key="SettingWindowHotkey">Open Setting Window</system:String>
<system:String x:Key="CopyFilePathHotkey">Copy File Path</system:String>
<system:String x:Key="CopyFilePathHotkey">העתק את נתיב הקובץ</system:String>
<system:String x:Key="ToggleGameModeHotkey">Toggle Game Mode</system:String>
<system:String x:Key="ToggleHistoryHotkey">Toggle History</system:String>
<system:String x:Key="OpenContainFolderHotkey">Open Containing Folder</system:String>
<system:String x:Key="RunAsAdminHotkey">Run As Admin</system:String>
<system:String x:Key="RunAsAdminHotkey">הרץ כמנהל</system:String>
<system:String x:Key="RequeryHotkey">Refresh Search Results</system:String>
<system:String x:Key="ReloadPluginHotkey">Reload Plugins Data</system:String>
<system:String x:Key="QuickWidthHotkey">Quick Adjust Window Width</system:String>
@ -234,13 +234,13 @@
<system:String x:Key="customQueryShortcut">Custom Query Shortcuts</system:String>
<system:String x:Key="builtinShortcuts">Built-in Shortcuts</system:String>
<system:String x:Key="customQuery">שאילתה</system:String>
<system:String x:Key="customShortcut">Shortcut</system:String>
<system:String x:Key="customShortcutExpansion">Expansion</system:String>
<system:String x:Key="builtinShortcutDescription">Description</system:String>
<system:String x:Key="customShortcut">קיצור דרך</system:String>
<system:String x:Key="customShortcutExpansion">הרחבה</system:String>
<system:String x:Key="builtinShortcutDescription">תיאור</system:String>
<system:String x:Key="delete">מחק</system:String>
<system:String x:Key="edit">ערוך</system:String>
<system:String x:Key="add">הוסף</system:String>
<system:String x:Key="none">None</system:String>
<system:String x:Key="none">ללא</system:String>
<system:String x:Key="pleaseSelectAnItem">אנא בחר פריט</system:String>
<system:String x:Key="deleteCustomHotkeyWarning">Are you sure you want to delete {0} plugin hotkey?</system:String>
<system:String x:Key="deleteCustomShortcutWarning">Are you sure you want to delete shortcut: {0} with expansion {1}?</system:String>
@ -259,8 +259,8 @@
<system:String x:Key="enableProxy">Enable HTTP Proxy</system:String>
<system:String x:Key="server">HTTP Server</system:String>
<system:String x:Key="port">Port</system:String>
<system:String x:Key="userName">User Name</system:String>
<system:String x:Key="password">Password</system:String>
<system:String x:Key="userName">שם משתמש</system:String>
<system:String x:Key="password">סיסמא</system:String>
<system:String x:Key="testProxy">Test Proxy</system:String>
<system:String x:Key="save">שמור</system:String>
<system:String x:Key="serverCantBeEmpty">Server field can't be empty</system:String>
@ -272,11 +272,11 @@
<!-- Setting About -->
<system:String x:Key="about">אודות</system:String>
<system:String x:Key="website">Website</system:String>
<system:String x:Key="github">GitHub</system:String>
<system:String x:Key="docs">Docs</system:String>
<system:String x:Key="version">Version</system:String>
<system:String x:Key="icons">Icons</system:String>
<system:String x:Key="website">אתר אינטרנט</system:String>
<system:String x:Key="github">Github</system:String>
<system:String x:Key="docs">תיעוד</system:String>
<system:String x:Key="version">גרסה</system:String>
<system:String x:Key="icons">סמלים</system:String>
<system:String x:Key="about_activate_times">You have activated Flow Launcher {0} times</system:String>
<system:String x:Key="checkUpdates">Check for Updates</system:String>
<system:String x:Key="BecomeASponsor">Become A Sponsor</system:String>
@ -302,8 +302,8 @@
<system:String x:Key="fileManagerWindow">Select File Manager</system:String>
<system:String x:Key="fileManager_tips">Please specify the file location of the file manager you using and add arguments as required. The &quot;%d&quot; represents the directory path to open for, used by the Arg for Folder field and for commands opening specific directories. The &quot;%f&quot; represents the file path to open for, used by the Arg for File field and for commands opening specific files.</system:String>
<system:String x:Key="fileManager_tips2">For example, if the file manager uses a command such as &quot;totalcmd.exe /A c:\windows&quot; to open the c:\windows directory, the File Manager Path will be totalcmd.exe, and the Arg For Folder will be /A &quot;%d&quot;. Certain file managers like QTTabBar may just require a path to be supplied, in this instance use &quot;%d&quot; as the File Manager Path and leave the rest of the fileds blank.</system:String>
<system:String x:Key="fileManager_name">File Manager</system:String>
<system:String x:Key="fileManager_profile_name">Profile Name</system:String>
<system:String x:Key="fileManager_name">מנהל קבצים</system:String>
<system:String x:Key="fileManager_profile_name">שם פרופיל</system:String>
<system:String x:Key="fileManager_path">File Manager Path</system:String>
<system:String x:Key="fileManager_directory_arg">Arg For Folder</system:String>
<system:String x:Key="fileManager_file_arg">Arg For File</system:String>
@ -314,9 +314,9 @@
<system:String x:Key="defaultBrowser_name">Browser</system:String>
<system:String x:Key="defaultBrowser_profile_name">Browser Name</system:String>
<system:String x:Key="defaultBrowser_path">Browser Path</system:String>
<system:String x:Key="defaultBrowser_newWindow">New Window</system:String>
<system:String x:Key="defaultBrowser_newTab">New Tab</system:String>
<system:String x:Key="defaultBrowser_parameter">Private Mode</system:String>
<system:String x:Key="defaultBrowser_newWindow">חלון חדש</system:String>
<system:String x:Key="defaultBrowser_newTab">כרטיסייה חדשה</system:String>
<system:String x:Key="defaultBrowser_parameter">מצב פרטיות</system:String>
<!-- Priority Setting Dialog -->
<system:String x:Key="changePriorityWindow">Change Priority</system:String>
@ -362,14 +362,14 @@ If you add an '@' prefix while inputting a shortcut, it matches any position in
<system:String x:Key="commonSave">שמור</system:String>
<system:String x:Key="commonOverwrite">Overwrite</system:String>
<system:String x:Key="commonCancel">ביטול</system:String>
<system:String x:Key="commonReset">Reset</system:String>
<system:String x:Key="commonReset">אפס</system:String>
<system:String x:Key="commonDelete">מחק</system:String>
<system:String x:Key="commonOK">OK</system:String>
<system:String x:Key="commonYes">Yes</system:String>
<system:String x:Key="commonNo">No</system:String>
<system:String x:Key="commonOK">אישור</system:String>
<system:String x:Key="commonYes">כן</system:String>
<system:String x:Key="commonNo">לא</system:String>
<!-- Crash Reporter -->
<system:String x:Key="reportWindow_version">Version</system:String>
<system:String x:Key="reportWindow_version">גרסה</system:String>
<system:String x:Key="reportWindow_time">זמן</system:String>
<system:String x:Key="reportWindow_reproduce">Please tell us how application crashed so we can fix it</system:String>
<system:String x:Key="reportWindow_send_report">שלח דיווח</system:String>
@ -377,21 +377,21 @@ If you add an '@' prefix while inputting a shortcut, it matches any position in
<system:String x:Key="reportWindow_general">כללי</system:String>
<system:String x:Key="reportWindow_exceptions">חריגים</system:String>
<system:String x:Key="reportWindow_exception_type">Exception Type</system:String>
<system:String x:Key="reportWindow_source">Source</system:String>
<system:String x:Key="reportWindow_source">מקור</system:String>
<system:String x:Key="reportWindow_stack_trace">Stack Trace</system:String>
<system:String x:Key="reportWindow_sending">Sending</system:String>
<system:String x:Key="reportWindow_sending">שולח</system:String>
<system:String x:Key="reportWindow_report_succeed">Report sent successfully</system:String>
<system:String x:Key="reportWindow_report_failed">Failed to send report</system:String>
<system:String x:Key="reportWindow_flowlauncher_got_an_error">Flow Launcher got an error</system:String>
<!-- General Notice -->
<system:String x:Key="pleaseWait">Please wait...</system:String>
<system:String x:Key="pleaseWait">אנא המתן...</system:String>
<!-- Update -->
<system:String x:Key="update_flowlauncher_update_check">Checking for new update</system:String>
<system:String x:Key="update_flowlauncher_already_on_latest">You already have the latest Flow Launcher version</system:String>
<system:String x:Key="update_flowlauncher_update_found">Update found</system:String>
<system:String x:Key="update_flowlauncher_updating">Updating...</system:String>
<system:String x:Key="update_flowlauncher_update_found">עדכון נמצא</system:String>
<system:String x:Key="update_flowlauncher_updating">מעדכן...</system:String>
<system:String x:Key="update_flowlauncher_fail_moving_portable_user_profile_data">
Flow Launcher was not able to move your user profile data to the new update version.
Please manually move your profile data folder from {0} to {1}
@ -405,7 +405,7 @@ If you add an '@' prefix while inputting a shortcut, it matches any position in
<system:String x:Key="update_flowlauncher_check_connection">Check your connection and try updating proxy settings to github-cloud.s3.amazonaws.com.</system:String>
<system:String x:Key="update_flowlauncher_update_restart_flowlauncher_tip">This upgrade will restart Flow Launcher</system:String>
<system:String x:Key="update_flowlauncher_update_update_files">Following files will be updated</system:String>
<system:String x:Key="update_flowlauncher_update_files">Update files</system:String>
<system:String x:Key="update_flowlauncher_update_files">עדכן קבצים</system:String>
<system:String x:Key="update_flowlauncher_update_update_description">Update description</system:String>
<!-- Welcome Window -->
@ -416,7 +416,7 @@ If you add an '@' prefix while inputting a shortcut, it matches any position in
<system:String x:Key="Welcome_Page2_Title">Search and run all files and applications on your PC</system:String>
<system:String x:Key="Welcome_Page2_Text01">Search everything from applications, files, bookmarks, YouTube, Twitter and more. All from the comfort of your keyboard without ever touching the mouse.</system:String>
<system:String x:Key="Welcome_Page2_Text02">Flow Launcher starts with the hotkey below, go ahead and try it out now. To change it, click on the input and press the desired hotkey on the keyboard.</system:String>
<system:String x:Key="Welcome_Page3_Title">Hotkeys</system:String>
<system:String x:Key="Welcome_Page3_Title">מקשי קיצור</system:String>
<system:String x:Key="Welcome_Page4_Title">Action Keyword and Commands</system:String>
<system:String x:Key="Welcome_Page4_Text01">Search the web, launch applications or run various functions through Flow Launcher plugins. Certain functions start with an action keyword, and if necessary, they can be used without action keywords. Try the queries below in Flow Launcher.</system:String>
<system:String x:Key="Welcome_Page5_Title">Let's Start Flow Launcher</system:String>

View file

@ -34,11 +34,11 @@ public partial class SettingWindow
private void OnLoaded(object sender, RoutedEventArgs e)
{
RefreshMaximizeRestoreButton();
// Fix (workaround) for the window freezes after lock screen (Win+L)
// Fix (workaround) for the window freezes after lock screen (Win+L) or sleep
// https://stackoverflow.com/questions/4951058/software-rendering-mode-wpf
HwndSource hwndSource = PresentationSource.FromVisual(this) as HwndSource;
HwndTarget hwndTarget = hwndSource.CompositionTarget;
hwndTarget.RenderMode = RenderMode.Default;
hwndTarget.RenderMode = RenderMode.SoftwareOnly; // Must use software only render mode here
InitializePosition();
}

View file

@ -182,7 +182,7 @@ namespace Flow.Launcher.ViewModel
/// <summary>
/// To avoid deadlock, this method should not called from main thread
/// </summary>
public void AddResults(IEnumerable<ResultsForUpdate> resultsForUpdates, CancellationToken token, bool reselect = true)
public void AddResults(ICollection<ResultsForUpdate> resultsForUpdates, CancellationToken token, bool reselect = true)
{
var newResults = NewResults(resultsForUpdates);
@ -228,12 +228,12 @@ namespace Flow.Launcher.ViewModel
.ToList();
}
private List<ResultViewModel> NewResults(IEnumerable<ResultsForUpdate> resultsForUpdates)
private List<ResultViewModel> NewResults(ICollection<ResultsForUpdate> resultsForUpdates)
{
if (!resultsForUpdates.Any())
return Results;
return Results.Where(r => r != null && !resultsForUpdates.Any(u => u.ID == r.Result.PluginID))
return Results.Where(r => r?.Result != null && resultsForUpdates.All(u => u.ID != r.Result.PluginID))
.Concat(resultsForUpdates.SelectMany(u => u.Results, (u, r) => new ResultViewModel(r, _settings)))
.OrderByDescending(rv => rv.Result.Score)
.ToList();

View file

@ -62,7 +62,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Mages" Version="2.0.2" />
<PackageReference Include="Mages" Version="3.0.0" />
</ItemGroup>
</Project>

View file

@ -29,8 +29,8 @@
<system:String x:Key="plugin_explorer_everything_setting_header">Everything Setting</system:String>
<system:String x:Key="plugin_explorer_previewpanel_setting_header">Preview Panel</system:String>
<system:String x:Key="plugin_explorer_previewpanel_display_file_size_checkbox">Size</system:String>
<system:String x:Key="plugin_explorer_previewpanel_display_file_creation_checkbox">Date Created</system:String>
<system:String x:Key="plugin_explorer_previewpanel_display_file_modification_checkbox">Date Modified</system:String>
<system:String x:Key="plugin_explorer_previewpanel_display_file_creation_checkbox">תאריך יצירה</system:String>
<system:String x:Key="plugin_explorer_previewpanel_display_file_modification_checkbox">תאריך שינוי</system:String>
<system:String x:Key="plugin_explorer_previewpanel_file_info_label">Display File Info</system:String>
<system:String x:Key="plugin_explorer_previewpanel_date_and_time_format_label">Date and time format</system:String>
<system:String x:Key="plugin_explorer_everything_sort_option">Sort Option:</system:String>
@ -126,20 +126,20 @@
<system:String x:Key="flowlauncher_plugin_everything_sdk_issue">Failed to load Everything SDK</system:String>
<system:String x:Key="flowlauncher_plugin_everything_is_not_running">אזהרה: שירות Everything אינו פועל</system:String>
<system:String x:Key="flowlauncher_plugin_everything_query_error">שגיאה במהלך שאילתה לEverything</system:String>
<system:String x:Key="flowlauncher_plugin_everything_sort_by">Sort By</system:String>
<system:String x:Key="flowlauncher_plugin_everything_sort_by">מיין לפי</system:String>
<system:String x:Key="flowlauncher_plugin_everything_sort_by_name">Name</system:String>
<system:String x:Key="flowlauncher_plugin_everything_sort_by_path">Path</system:String>
<system:String x:Key="flowlauncher_plugin_everything_sort_by_path">נתיב</system:String>
<system:String x:Key="flowlauncher_plugin_everything_sort_by_size">Size</system:String>
<system:String x:Key="flowlauncher_plugin_everything_sort_by_extension">Extension</system:String>
<system:String x:Key="flowlauncher_plugin_everything_sort_by_type_name">Type Name</system:String>
<system:String x:Key="flowlauncher_plugin_everything_sort_by_date_created">Date Created</system:String>
<system:String x:Key="flowlauncher_plugin_everything_sort_by_date_modified">Date Modified</system:String>
<system:String x:Key="flowlauncher_plugin_everything_sort_by_attributes">Attributes</system:String>
<system:String x:Key="flowlauncher_plugin_everything_sort_by_date_created">תאריך יצירה</system:String>
<system:String x:Key="flowlauncher_plugin_everything_sort_by_date_modified">תאריך שינוי</system:String>
<system:String x:Key="flowlauncher_plugin_everything_sort_by_attributes">מאפיינים</system:String>
<system:String x:Key="flowlauncher_plugin_everything_sort_by_file_list_filename">File List FileName</system:String>
<system:String x:Key="flowlauncher_plugin_everything_sort_by_run_count">Run Count</system:String>
<system:String x:Key="flowlauncher_plugin_everything_sort_by_date_recently_changed">Date Recently Changed</system:String>
<system:String x:Key="flowlauncher_plugin_everything_sort_by_date_accessed">Date Accessed</system:String>
<system:String x:Key="flowlauncher_plugin_everything_sort_by_date_run">Date Run</system:String>
<system:String x:Key="flowlauncher_plugin_everything_sort_by_date_recently_changed">תאריך שינוי אחרון</system:String>
<system:String x:Key="flowlauncher_plugin_everything_sort_by_date_accessed">תאריך גישה</system:String>
<system:String x:Key="flowlauncher_plugin_everything_sort_by_date_run">תאריך הרצה</system:String>
<system:String x:Key="flowlauncher_plugin_everything_sort_by_ascending">↑</system:String>
<system:String x:Key="flowlauncher_plugin_everything_sort_by_descending">↓</system:String>
<system:String x:Key="flowlauncher_plugin_everything_nonfastsort_warning">Warning: This is not a Fast Sort option, searches may be slow</system:String>
@ -149,11 +149,11 @@
<system:String x:Key="flowlauncher_plugin_everything_click_to_launch_or_install">Click to launch or install Everything</system:String>
<system:String x:Key="flowlauncher_plugin_everything_installing_title">Everything Installation</system:String>
<system:String x:Key="flowlauncher_plugin_everything_installing_subtitle">Installing Everything service. Please wait...</system:String>
<system:String x:Key="flowlauncher_plugin_everything_installationsuccess_subtitle">Successfully installed Everything service</system:String>
<system:String x:Key="flowlauncher_plugin_everything_installationfailed_subtitle">Failed to automatically install Everything service. Please manually install it from https://www.voidtools.com</system:String>
<system:String x:Key="flowlauncher_plugin_everything_installing_subtitle">מתקין את שירות Everything. אנא המתן...</system:String>
<system:String x:Key="flowlauncher_plugin_everything_installationsuccess_subtitle">שירות Everything הותקן בהצלחה</system:String>
<system:String x:Key="flowlauncher_plugin_everything_installationfailed_subtitle">התקנה אוטומטית של שירות Everything נכשלה. אנא הורד אותו ידנית מ- https://www.voidtools.com</system:String>
<system:String x:Key="flowlauncher_plugin_everything_run_service">Click here to start it</system:String>
<system:String x:Key="flowlauncher_plugin_everything_installing_select">Unable to find an Everything installation, would you like to manually select a location?{0}{0}Click no and Everything will be automatically installed for you</system:String>
<system:String x:Key="flowlauncher_plugin_everything_installing_select">לא מצליח למצוא התקנה של Everything, האם תרצה לבחור מיקום באופן ידני?{0}{0}לחץ על לא וEverything יותקן עבורך אוטומטית</system:String>
<system:String x:Key="flowlauncher_plugin_everything_enable_content_search">Do you want to enable content search for Everything?</system:String>
<system:String x:Key="flowlauncher_plugin_everything_enable_content_search_tips">It can be very slow without index (which is only supported in Everything v1.5+)</system:String>

View file

@ -1,10 +1,9 @@
using Flow.Launcher.Core.ExternalPlugins;
using Flow.Launcher.Infrastructure.UserSettings;
using ICSharpCode.SharpZipLib.Zip;
using Newtonsoft.Json;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Text.Json;
namespace Flow.Launcher.Plugin.PluginsManager
{
@ -72,12 +71,9 @@ namespace Flow.Launcher.Plugin.PluginsManager
if (pluginJsonEntry != null)
{
using (StreamReader reader = new StreamReader(pluginJsonEntry.Open()))
{
string pluginJsonContent = reader.ReadToEnd();
plugin = JsonConvert.DeserializeObject<UserPlugin>(pluginJsonContent);
plugin.IcoPath = "Images\\zipfolder.png";
}
using Stream stream = pluginJsonEntry.Open();
plugin = JsonSerializer.Deserialize<UserPlugin>(stream);
plugin.IcoPath = "Images\\zipfolder.png";
}
}

View file

@ -41,9 +41,36 @@ namespace Flow.Launcher.Plugin.Program
"uninst000.exe",
"uninstall.exe"
};
// For cases when the uninstaller is named like "Uninstall Program Name.exe"
private const string CommonUninstallerPrefix = "uninstall";
private const string CommonUninstallerSuffix = ".exe";
private static readonly string[] commonUninstallerPrefixs =
{
"uninstall",//en
"卸载",//zh-cn
"卸載",//zh-tw
"видалити",//uk-UA
"удалить",//ru
"désinstaller",//fr
"アンインストール",//ja
"deïnstalleren",//nl
"odinstaluj",//pl
"afinstallere",//da
"deinstallieren",//de
"삭제",//ko
"деинсталирај",//sr
"desinstalar",//pt-pt
"desinstalar",//pt-br
"desinstalar",//es
"desinstalar",//es-419
"disinstallare",//it
"avinstallere",//nb-NO
"odinštalovať",//sk
"kaldır",//tr
"odinstalovat",//cs
"إلغاء التثبيت",//ar
"gỡ bỏ",//vi-vn
"הסרה"//he
};
private const string ExeUninstallerSuffix = ".exe";
private const string InkUninstallerSuffix = ".lnk";
static Main()
{
@ -96,10 +123,33 @@ namespace Flow.Launcher.Plugin.Program
{
if (!_settings.HideUninstallers) return true;
if (program is not Win32 win32) return true;
// First check the executable path
var fileName = Path.GetFileName(win32.ExecutablePath);
return !commonUninstallerNames.Contains(fileName, StringComparer.OrdinalIgnoreCase) &&
!(fileName.StartsWith(CommonUninstallerPrefix, StringComparison.OrdinalIgnoreCase) &&
fileName.EndsWith(CommonUninstallerSuffix, StringComparison.OrdinalIgnoreCase));
// For cases when the uninstaller is named like "uninst.exe"
if (commonUninstallerNames.Contains(fileName, StringComparer.OrdinalIgnoreCase)) return false;
// For cases when the uninstaller is named like "Uninstall Program Name.exe"
foreach (var prefix in commonUninstallerPrefixs)
{
if (fileName.StartsWith(prefix, StringComparison.OrdinalIgnoreCase) &&
fileName.EndsWith(ExeUninstallerSuffix, StringComparison.OrdinalIgnoreCase))
return false;
}
// Second check the lnk path
if (!string.IsNullOrEmpty(win32.LnkResolvedPath))
{
var inkFileName = Path.GetFileName(win32.FullPath);
// For cases when the uninstaller is named like "Uninstall Program Name.ink"
foreach (var prefix in commonUninstallerPrefixs)
{
if (inkFileName.StartsWith(prefix, StringComparison.OrdinalIgnoreCase) &&
inkFileName.EndsWith(InkUninstallerSuffix, StringComparison.OrdinalIgnoreCase))
return false;
}
}
return true;
}
public async Task InitAsync(PluginInitContext context)

View file

@ -2130,7 +2130,7 @@
<value>Ändern, wie der Mauszeiger ausschaut</value>
</data>
<data name="ChangePowerSavingSettings" xml:space="preserve">
<value>Change power-saving settings</value>
<value>Energiespareinstellungen ändern</value>
</data>
<data name="OptimiseForBlindness" xml:space="preserve">
<value>Optimieren für Blindheit</value>
@ -2143,7 +2143,7 @@
<value>Windows-Features ein- oder ausschalten</value>
</data>
<data name="ShowWhichOperatingSystemYourComputerIsRunning" xml:space="preserve">
<value>Show which operating system your computer is running</value>
<value>Betriebssystem, welches auf deinem Computer läuft, anzeigen</value>
</data>
<data name="ViewLocalServices" xml:space="preserve">
<value>Lokale Dienste ansehen</value>