From 41a345a70006e881709b1c6543e683926289b583 Mon Sep 17 00:00:00 2001 From: Hongtao Zhang Date: Fri, 6 Dec 2024 23:55:20 -0600 Subject: [PATCH 01/26] Remove Result comparison and Change signature from IEnumerable to ICollection (due to the potential of multiple enumeration) --- Flow.Launcher.Plugin/Result.cs | 21 --------------------- Flow.Launcher/ViewModel/ResultsViewModel.cs | 6 +++--- 2 files changed, 3 insertions(+), 24 deletions(-) diff --git a/Flow.Launcher.Plugin/Result.cs b/Flow.Launcher.Plugin/Result.cs index 9b42b1021..ac0b827c0 100644 --- a/Flow.Launcher.Plugin/Result.cs +++ b/Flow.Launcher.Plugin/Result.cs @@ -156,27 +156,6 @@ namespace Flow.Launcher.Plugin } } - /// - 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; - } - - /// - public override int GetHashCode() - { - return HashCode.Combine(Title, SubTitle, AutoCompleteText, CopyText, IcoPath); - } - /// public override string ToString() { diff --git a/Flow.Launcher/ViewModel/ResultsViewModel.cs b/Flow.Launcher/ViewModel/ResultsViewModel.cs index 107372e01..c0e0b146d 100644 --- a/Flow.Launcher/ViewModel/ResultsViewModel.cs +++ b/Flow.Launcher/ViewModel/ResultsViewModel.cs @@ -182,7 +182,7 @@ namespace Flow.Launcher.ViewModel /// /// To avoid deadlock, this method should not called from main thread /// - public void AddResults(IEnumerable resultsForUpdates, CancellationToken token, bool reselect = true) + public void AddResults(ICollection resultsForUpdates, CancellationToken token, bool reselect = true) { var newResults = NewResults(resultsForUpdates); @@ -228,12 +228,12 @@ namespace Flow.Launcher.ViewModel .ToList(); } - private List NewResults(IEnumerable resultsForUpdates) + private List NewResults(ICollection 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 != 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(); From 51a16cc40f8159f6e54d772df16e5ae0466be989 Mon Sep 17 00:00:00 2001 From: Hongtao Zhang Date: Fri, 6 Dec 2024 23:55:20 -0600 Subject: [PATCH 02/26] Remove Result comparison and Change signature from IEnumerable to ICollection (due to the potential of multiple enumeration) --- Flow.Launcher.Plugin/Result.cs | 21 --------------------- Flow.Launcher/ViewModel/ResultsViewModel.cs | 6 +++--- 2 files changed, 3 insertions(+), 24 deletions(-) diff --git a/Flow.Launcher.Plugin/Result.cs b/Flow.Launcher.Plugin/Result.cs index f2050cc9f..c6ca81cf3 100644 --- a/Flow.Launcher.Plugin/Result.cs +++ b/Flow.Launcher.Plugin/Result.cs @@ -157,27 +157,6 @@ namespace Flow.Launcher.Plugin } } - /// - 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; - } - - /// - public override int GetHashCode() - { - return HashCode.Combine(Title, SubTitle, AutoCompleteText, CopyText, IcoPath); - } - /// public override string ToString() { diff --git a/Flow.Launcher/ViewModel/ResultsViewModel.cs b/Flow.Launcher/ViewModel/ResultsViewModel.cs index 107372e01..c0e0b146d 100644 --- a/Flow.Launcher/ViewModel/ResultsViewModel.cs +++ b/Flow.Launcher/ViewModel/ResultsViewModel.cs @@ -182,7 +182,7 @@ namespace Flow.Launcher.ViewModel /// /// To avoid deadlock, this method should not called from main thread /// - public void AddResults(IEnumerable resultsForUpdates, CancellationToken token, bool reselect = true) + public void AddResults(ICollection resultsForUpdates, CancellationToken token, bool reselect = true) { var newResults = NewResults(resultsForUpdates); @@ -228,12 +228,12 @@ namespace Flow.Launcher.ViewModel .ToList(); } - private List NewResults(IEnumerable resultsForUpdates) + private List NewResults(ICollection 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 != 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(); From 5f6ac6a35e38c301ffb2b8b2fdc5af95869b3703 Mon Sep 17 00:00:00 2001 From: Kevin Zhang <45326534+taooceros@users.noreply.github.com> Date: Sat, 7 Dec 2024 12:48:15 -0600 Subject: [PATCH 03/26] Update Flow.Launcher/ViewModel/ResultsViewModel.cs Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- Flow.Launcher/ViewModel/ResultsViewModel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Flow.Launcher/ViewModel/ResultsViewModel.cs b/Flow.Launcher/ViewModel/ResultsViewModel.cs index c0e0b146d..7d2b5bc93 100644 --- a/Flow.Launcher/ViewModel/ResultsViewModel.cs +++ b/Flow.Launcher/ViewModel/ResultsViewModel.cs @@ -233,7 +233,7 @@ namespace Flow.Launcher.ViewModel if (!resultsForUpdates.Any()) return Results; - return Results.Where(r => r != null && resultsForUpdates.All(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(); From 921d6a3beb6a3c05ca00e6ce70a41fbf9e98b21b Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Thu, 2 Jan 2025 18:47:25 +0800 Subject: [PATCH 04/26] Add support for system language item --- .../Resource/Internationalization.cs | 51 ++++++++++++++++--- 1 file changed, 45 insertions(+), 6 deletions(-) diff --git a/Flow.Launcher.Core/Resource/Internationalization.cs b/Flow.Launcher.Core/Resource/Internationalization.cs index 1505e84f8..aac6ecc1e 100644 --- a/Flow.Launcher.Core/Resource/Internationalization.cs +++ b/Flow.Launcher.Core/Resource/Internationalization.cs @@ -18,6 +18,8 @@ namespace Flow.Launcher.Core.Resource { public Settings Settings { get; set; } private const string Folder = "Languages"; + private const string SystemLanguageCode = "System"; + private const string DefaultLanguageCode = "en"; private const string DefaultFile = "en.xaml"; private const string Extension = ".xaml"; private readonly List _languageDirectories = new List(); @@ -68,8 +70,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 == SystemLanguageCode) + { + languageCode = GetSystemLanguageCode(); + isSystem = true; + } + + // Get language by language code and change language + var language = GetLanguageByLanguageCode(languageCode); + ChangeLanguage(language, isSystem); } private Language GetLanguageByLanguageCode(string languageCode) @@ -87,11 +99,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 +114,7 @@ namespace Flow.Launcher.Core.Resource CultureInfo.CurrentUICulture = CultureInfo.CurrentCulture; // Raise event after culture is set - Settings.Language = language.LanguageCode; + Settings.Language = isSystem ? SystemLanguageCode : language.LanguageCode; _ = Task.Run(() => { UpdatePluginMetadataTranslations(); @@ -167,7 +178,35 @@ namespace Flow.Launcher.Core.Resource public List LoadAvailableLanguages() { - return AvailableLanguages.GetAvailableLanguages(); + var list = AvailableLanguages.GetAvailableLanguages(); + list.Insert(0, new Language(SystemLanguageCode, "System")); + return list; + } + + private string GetSystemLanguageCode() + { + var availableLanguages = AvailableLanguages.GetAvailableLanguages(); + + // Retrieve the language identifiers for the current culture + 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; } public string GetTranslation(string key) From 0ae3cfcdd6f735b6f8e16ffa0e782c394fbd2e68 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Thu, 2 Jan 2025 18:50:02 +0800 Subject: [PATCH 05/26] Add display translation for system language item --- .../Resource/AvailableLanguages.cs | 34 ++++++++++++++++++- .../Resource/Internationalization.cs | 2 +- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/Flow.Launcher.Core/Resource/AvailableLanguages.cs b/Flow.Launcher.Core/Resource/AvailableLanguages.cs index c385cd8e8..ecaecf646 100644 --- a/Flow.Launcher.Core/Resource/AvailableLanguages.cs +++ b/Flow.Launcher.Core/Resource/AvailableLanguages.cs @@ -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 GetAvailableLanguages() { List languages = new List @@ -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", + }; + } } } diff --git a/Flow.Launcher.Core/Resource/Internationalization.cs b/Flow.Launcher.Core/Resource/Internationalization.cs index aac6ecc1e..4db3e8633 100644 --- a/Flow.Launcher.Core/Resource/Internationalization.cs +++ b/Flow.Launcher.Core/Resource/Internationalization.cs @@ -179,7 +179,7 @@ namespace Flow.Launcher.Core.Resource public List LoadAvailableLanguages() { var list = AvailableLanguages.GetAvailableLanguages(); - list.Insert(0, new Language(SystemLanguageCode, "System")); + list.Insert(0, new Language(SystemLanguageCode, AvailableLanguages.GetSystemTranslation(GetSystemLanguageCode()))); return list; } From 5d623123fc72554a87a8fbf8d0e33f52a3638d3c Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Sat, 4 Jan 2025 14:02:50 +0800 Subject: [PATCH 06/26] Fix operator equal application issue --- Flow.Launcher.Infrastructure/FileExplorerHelper.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Flow.Launcher.Infrastructure/FileExplorerHelper.cs b/Flow.Launcher.Infrastructure/FileExplorerHelper.cs index b738b9c88..65f424e33 100644 --- a/Flow.Launcher.Infrastructure/FileExplorerHelper.cs +++ b/Flow.Launcher.Infrastructure/FileExplorerHelper.cs @@ -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 => x.HWND == wnd.Value.ToInt64()); if (searchIndex != -1) { z[searchIndex] = index; From 56069e657c55a0714dc0c0a6571ac554c12391b4 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Sun, 5 Jan 2025 15:31:14 +0800 Subject: [PATCH 07/26] Improve code quality --- Flow.Launcher.Infrastructure/FileExplorerHelper.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Flow.Launcher.Infrastructure/FileExplorerHelper.cs b/Flow.Launcher.Infrastructure/FileExplorerHelper.cs index 65f424e33..d908b0fde 100644 --- a/Flow.Launcher.Infrastructure/FileExplorerHelper.cs +++ b/Flow.Launcher.Infrastructure/FileExplorerHelper.cs @@ -68,7 +68,7 @@ namespace Flow.Launcher.Infrastructure var numRemaining = hWnds.Count; PInvoke.EnumWindows((wnd, _) => { - var searchIndex = hWnds.FindIndex(x => x.HWND == wnd.Value.ToInt64()); + var searchIndex = hWnds.FindIndex(x => new IntPtr(x.HWND) == wnd); if (searchIndex != -1) { z[searchIndex] = index; From 3ccd8b42ae53ccd33f66492f6134078a2656c96b Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Mon, 6 Jan 2025 16:58:08 +0800 Subject: [PATCH 08/26] Move SystemLanguageCode to constant --- Flow.Launcher.Core/Resource/Internationalization.cs | 7 +++---- Flow.Launcher.Infrastructure/Constant.cs | 2 ++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Flow.Launcher.Core/Resource/Internationalization.cs b/Flow.Launcher.Core/Resource/Internationalization.cs index 4db3e8633..70f23c897 100644 --- a/Flow.Launcher.Core/Resource/Internationalization.cs +++ b/Flow.Launcher.Core/Resource/Internationalization.cs @@ -18,7 +18,6 @@ namespace Flow.Launcher.Core.Resource { public Settings Settings { get; set; } private const string Folder = "Languages"; - private const string SystemLanguageCode = "System"; private const string DefaultLanguageCode = "en"; private const string DefaultFile = "en.xaml"; private const string Extension = ".xaml"; @@ -73,7 +72,7 @@ namespace Flow.Launcher.Core.Resource // Get actual language if language code is system var isSystem = false; - if (languageCode == SystemLanguageCode) + if (languageCode == Constant.SystemLanguageCode) { languageCode = GetSystemLanguageCode(); isSystem = true; @@ -114,7 +113,7 @@ namespace Flow.Launcher.Core.Resource CultureInfo.CurrentUICulture = CultureInfo.CurrentCulture; // Raise event after culture is set - Settings.Language = isSystem ? SystemLanguageCode : language.LanguageCode; + Settings.Language = isSystem ? Constant.SystemLanguageCode : language.LanguageCode; _ = Task.Run(() => { UpdatePluginMetadataTranslations(); @@ -179,7 +178,7 @@ namespace Flow.Launcher.Core.Resource public List LoadAvailableLanguages() { var list = AvailableLanguages.GetAvailableLanguages(); - list.Insert(0, new Language(SystemLanguageCode, AvailableLanguages.GetSystemTranslation(GetSystemLanguageCode()))); + list.Insert(0, new Language(Constant.SystemLanguageCode, AvailableLanguages.GetSystemTranslation(GetSystemLanguageCode()))); return list; } diff --git a/Flow.Launcher.Infrastructure/Constant.cs b/Flow.Launcher.Infrastructure/Constant.cs index 2889e5ec7..f03d327f2 100644 --- a/Flow.Launcher.Infrastructure/Constant.cs +++ b/Flow.Launcher.Infrastructure/Constant.cs @@ -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"; } } From 6febbe719a956d1e9928e9d690c70ffa55105467 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Mon, 6 Jan 2025 16:58:19 +0800 Subject: [PATCH 09/26] Use system language as default in settings --- Flow.Launcher.Infrastructure/UserSettings/Settings.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs index 83f06279c..5b5d10e6e 100644 --- a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs +++ b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs @@ -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.Alt} + {KeyConstant.Space}"; public string OpenResultModifiers { get; set; } = KeyConstant.Alt; From 46c2c1f6683e50652afbfa541f187d15fb6275b6 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Mon, 6 Jan 2025 19:20:47 +0800 Subject: [PATCH 10/26] Change system language code to lowercase --- Flow.Launcher.Infrastructure/Constant.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Flow.Launcher.Infrastructure/Constant.cs b/Flow.Launcher.Infrastructure/Constant.cs index f03d327f2..c86ed4324 100644 --- a/Flow.Launcher.Infrastructure/Constant.cs +++ b/Flow.Launcher.Infrastructure/Constant.cs @@ -53,6 +53,6 @@ namespace Flow.Launcher.Infrastructure public const string GitHub = "https://github.com/Flow-Launcher/Flow.Launcher"; public const string Docs = "https://flowlauncher.com/docs"; - public const string SystemLanguageCode = "System"; + public const string SystemLanguageCode = "system"; } } From ad0270079d9404dd37b385a6d9db8b52e0668d99 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Thu, 9 Jan 2025 20:57:43 +0800 Subject: [PATCH 11/26] Use System.Text.Json to replace Newtonsoft.Json for better performance --- .../Utilities.cs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/Utilities.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/Utilities.cs index 9800fa020..19f911818 100644 --- a/Plugins/Flow.Launcher.Plugin.PluginsManager/Utilities.cs +++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/Utilities.cs @@ -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,10 @@ namespace Flow.Launcher.Plugin.PluginsManager if (pluginJsonEntry != null) { - using (StreamReader reader = new StreamReader(pluginJsonEntry.Open())) - { - string pluginJsonContent = reader.ReadToEnd(); - plugin = JsonConvert.DeserializeObject(pluginJsonContent); - plugin.IcoPath = "Images\\zipfolder.png"; - } + using StreamReader reader = new StreamReader(pluginJsonEntry.Open()); + string pluginJsonContent = reader.ReadToEnd(); + plugin = JsonSerializer.Deserialize(pluginJsonContent); + plugin.IcoPath = "Images\\zipfolder.png"; } } From cfc0534a545b4a369b850057800862406c28347d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 9 Jan 2025 22:52:09 -0600 Subject: [PATCH 12/26] Bump SemanticVersioning from 3.0.0-beta2 to 3.0.0 (#3172) Bumps [SemanticVersioning](https://github.com/adamreeve/semver.net) from 3.0.0-beta2 to 3.0.0. - [Release notes](https://github.com/adamreeve/semver.net/releases) - [Commits](https://github.com/adamreeve/semver.net/compare/3.0.0-beta2...3.0.0) --- updated-dependencies: - dependency-name: SemanticVersioning dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Flow.Launcher/Flow.Launcher.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Flow.Launcher/Flow.Launcher.csproj b/Flow.Launcher/Flow.Launcher.csproj index 4ec249c2b..788beddfb 100644 --- a/Flow.Launcher/Flow.Launcher.csproj +++ b/Flow.Launcher/Flow.Launcher.csproj @@ -99,7 +99,7 @@ - + From f1746b09e02ed16be46f142a45f55c4340f33417 Mon Sep 17 00:00:00 2001 From: Jeremy Wu Date: Fri, 10 Jan 2025 16:26:20 +1100 Subject: [PATCH 13/26] New Crowdin updates (#3149) New translations --- Flow.Launcher/Languages/de.xaml | 4 +- Flow.Launcher/Languages/es.xaml | 4 +- Flow.Launcher/Languages/he.xaml | 108 +++++++++--------- .../Languages/he.xaml | 28 ++--- .../Properties/Resources.de-DE.resx | 4 +- 5 files changed, 74 insertions(+), 74 deletions(-) diff --git a/Flow.Launcher/Languages/de.xaml b/Flow.Launcher/Languages/de.xaml index 7f2e2bd8d..c7e775ae3 100644 --- a/Flow.Launcher/Languages/de.xaml +++ b/Flow.Launcher/Languages/de.xaml @@ -65,8 +65,8 @@ Letzte Abfrage beibehalten Letzte Abfrage auswählen Letzte Abfrage leeren - Preserve Last Action Keyword - Select Last Action Keyword + Letztes Aktions-Schlüsselwort beibehalten + Letztes Aktions-Schlüsselwort auswählen Feste Fensterhöhe Die Fensterhöhe ist durch Ziehen nicht anpassbar. Maximal gezeigte Ergebnisse diff --git a/Flow.Launcher/Languages/es.xaml b/Flow.Launcher/Languages/es.xaml index bf22aea48..c7595f69b 100644 --- a/Flow.Launcher/Languages/es.xaml +++ b/Flow.Launcher/Languages/es.xaml @@ -65,8 +65,8 @@ Mantener la última consulta Seleccionar la última consulta Limpiar la última consulta - Conservar palabra clave de última acción - Seleccionar palabra clave de última acción + Conservar última palabra clave de acción + Seleccionar última palabra clave de acción Altura de la ventana fija La altura de la ventana no se puede ajustar arrastrando el ratón. Número máximo de resultados mostrados diff --git a/Flow.Launcher/Languages/he.xaml b/Flow.Launcher/Languages/he.xaml index eeb33da17..f3c9bb307 100644 --- a/Flow.Launcher/Languages/he.xaml +++ b/Flow.Launcher/Languages/he.xaml @@ -9,7 +9,7 @@ אנא בחר את קובץ ההפעלה {0} לא ניתן להגדיר נתיב הפעלה {0}, אנא נסה שוב בהגדרות Flow (גלול עד למטה). נכשל בהפעלת תוספים - תוספים: {0} - נכשלים בטעינה ויהיו מושבתים, אנא צור קשר עם יוצרי התוספים לקבלת עזרה + תוספים: {0} - נכשלו בטעינה ויושבתו, אנא צור קשר עם יוצרי התוספים לקבלת עזרה רישום מקש הקיצור "{0}" נכשל. ייתכן שמקש הקיצור נמצא בשימוש על ידי תוכנה אחרת. שנה למקש קיצור אחר, או צא מהתוכנה האחרת. @@ -54,10 +54,10 @@ צג ראשי צג מותאם אישית Search Window Position on Monitor - Center - Center Top - Left Top - Right Top + מרכז + מרכז עליון + שמאל עליון + ימין עליון Custom Position שפה Last Query Style @@ -83,16 +83,16 @@ Please select pythonw.exe Always Start Typing in English Mode Temporarily change your input method to English mode when activating Flow. - Auto Update - Select + עדכון אוטומטי + בחר Hide Flow Launcher on startup Flow Launcher search window is hidden in the tray after starting up. Hide tray icon When the icon is hidden from the tray, the Settings menu can be opened by right-clicking on the search window. Query Search Precision Changes minimum match score required for results. - None - Low + ללא + נמוך Regular Search with Pinyin Allows using Pinyin to search. Pinyin is the standard system of romanized spelling for translating Chinese. @@ -120,26 +120,26 @@ Priority Change Plugin Results Priority Plugin Directory - by + מאת Init time: Query time: - Version - Website - Uninstall + גרסה + אתר + הסר התקנה חנות תוספים - New Release + שחרור חדש Recently Updated תוספים - Installed + מותקן רענן התקן - Uninstall + הסר התקנה עדכון Plugin already installed - New Version + גרסה חדשה This plugin has been updated within the last 7 days New Update is Available @@ -164,7 +164,7 @@ Query Box Font Result Title Font Result Subtitle Font - Reset + אפס Customize Window Mode Opacity @@ -196,9 +196,9 @@ - Hotkey - Hotkeys - Open Flow Launcher + מקש קיצור + מקשי קיצור + פתח את Flow Launcher Enter shortcut to show/hide Flow Launcher. Toggle Preview Enter shortcut to show/hide preview in search window. @@ -206,24 +206,24 @@ List of currently registered hotkeys Open Result Modifier Key Select a modifier key to open selected result via keyboard. - Show Hotkey + הצג מקש קיצור Show result selection hotkey with results. Auto Complete Runs autocomplete for the selected items. Select Next Item Select Previous Item - Next Page - Previous Page + הדף הבא + הדף הקודם Cycle Previous Query Cycle Next Query Open Context Menu Open Native Context Menu Open Setting Window - Copy File Path + העתק את נתיב הקובץ Toggle Game Mode Toggle History Open Containing Folder - Run As Admin + הרץ כמנהל Refresh Search Results Reload Plugins Data Quick Adjust Window Width @@ -234,13 +234,13 @@ Custom Query Shortcuts Built-in Shortcuts שאילתה - Shortcut - Expansion - Description + קיצור דרך + הרחבה + תיאור מחק ערוך הוסף - None + ללא אנא בחר פריט Are you sure you want to delete {0} plugin hotkey? Are you sure you want to delete shortcut: {0} with expansion {1}? @@ -259,8 +259,8 @@ Enable HTTP Proxy HTTP Server Port - User Name - Password + שם משתמש + סיסמא Test Proxy שמור Server field can't be empty @@ -272,11 +272,11 @@ אודות - Website - GitHub - Docs - Version - Icons + אתר אינטרנט + Github + תיעוד + גרסה + סמלים You have activated Flow Launcher {0} times Check for Updates Become A Sponsor @@ -302,8 +302,8 @@ Select File Manager Please specify the file location of the file manager you using and add arguments as required. The "%d" represents the directory path to open for, used by the Arg for Folder field and for commands opening specific directories. The "%f" represents the file path to open for, used by the Arg for File field and for commands opening specific files. For example, if the file manager uses a command such as "totalcmd.exe /A c:\windows" to open the c:\windows directory, the File Manager Path will be totalcmd.exe, and the Arg For Folder will be /A "%d". Certain file managers like QTTabBar may just require a path to be supplied, in this instance use "%d" as the File Manager Path and leave the rest of the fileds blank. - File Manager - Profile Name + מנהל קבצים + שם פרופיל File Manager Path Arg For Folder Arg For File @@ -314,9 +314,9 @@ Browser Browser Name Browser Path - New Window - New Tab - Private Mode + חלון חדש + כרטיסייה חדשה + מצב פרטיות Change Priority @@ -362,14 +362,14 @@ If you add an '@' prefix while inputting a shortcut, it matches any position in שמור Overwrite ביטול - Reset + אפס מחק - OK - Yes - No + אישור + כן + לא - Version + גרסה זמן Please tell us how application crashed so we can fix it שלח דיווח @@ -377,21 +377,21 @@ If you add an '@' prefix while inputting a shortcut, it matches any position in כללי חריגים Exception Type - Source + מקור Stack Trace - Sending + שולח Report sent successfully Failed to send report Flow Launcher got an error - Please wait... + אנא המתן... Checking for new update You already have the latest Flow Launcher version - Update found - Updating... + עדכון נמצא + מעדכן... 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 Check your connection and try updating proxy settings to github-cloud.s3.amazonaws.com. This upgrade will restart Flow Launcher Following files will be updated - Update files + עדכן קבצים Update description @@ -416,7 +416,7 @@ If you add an '@' prefix while inputting a shortcut, it matches any position in Search and run all files and applications on your PC Search everything from applications, files, bookmarks, YouTube, Twitter and more. All from the comfort of your keyboard without ever touching the mouse. 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. - Hotkeys + מקשי קיצור Action Keyword and Commands 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. Let's Start Flow Launcher diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/he.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/he.xaml index 0e1753d67..f87dd7d63 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/he.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/he.xaml @@ -29,8 +29,8 @@ Everything Setting Preview Panel Size - Date Created - Date Modified + תאריך יצירה + תאריך שינוי Display File Info Date and time format Sort Option: @@ -126,20 +126,20 @@ Failed to load Everything SDK אזהרה: שירות Everything אינו פועל שגיאה במהלך שאילתה לEverything - Sort By + מיין לפי Name - Path + נתיב Size Extension Type Name - Date Created - Date Modified - Attributes + תאריך יצירה + תאריך שינוי + מאפיינים File List FileName Run Count - Date Recently Changed - Date Accessed - Date Run + תאריך שינוי אחרון + תאריך גישה + תאריך הרצה Warning: This is not a Fast Sort option, searches may be slow @@ -149,11 +149,11 @@ Click to launch or install Everything Everything Installation - Installing Everything service. Please wait... - Successfully installed Everything service - Failed to automatically install Everything service. Please manually install it from https://www.voidtools.com + מתקין את שירות Everything. אנא המתן... + שירות Everything הותקן בהצלחה + התקנה אוטומטית של שירות Everything נכשלה. אנא הורד אותו ידנית מ- https://www.voidtools.com Click here to start it - 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 + לא מצליח למצוא התקנה של Everything, האם תרצה לבחור מיקום באופן ידני?{0}{0}לחץ על לא וEverything יותקן עבורך אוטומטית Do you want to enable content search for Everything? It can be very slow without index (which is only supported in Everything v1.5+) diff --git a/Plugins/Flow.Launcher.Plugin.WindowsSettings/Properties/Resources.de-DE.resx b/Plugins/Flow.Launcher.Plugin.WindowsSettings/Properties/Resources.de-DE.resx index dac5f82bc..dcc74d520 100644 --- a/Plugins/Flow.Launcher.Plugin.WindowsSettings/Properties/Resources.de-DE.resx +++ b/Plugins/Flow.Launcher.Plugin.WindowsSettings/Properties/Resources.de-DE.resx @@ -2130,7 +2130,7 @@ Ändern, wie der Mauszeiger ausschaut - Change power-saving settings + Energiespareinstellungen ändern Optimieren für Blindheit @@ -2143,7 +2143,7 @@ Windows-Features ein- oder ausschalten - Show which operating system your computer is running + Betriebssystem, welches auf deinem Computer läuft, anzeigen Lokale Dienste ansehen From 95b4c4c766bc07b77285f7e7a0e525d35c6b08d0 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Fri, 10 Jan 2025 13:34:10 +0800 Subject: [PATCH 14/26] Improve code quality --- Plugins/Flow.Launcher.Plugin.PluginsManager/Utilities.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/Utilities.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/Utilities.cs index 19f911818..743f5b25b 100644 --- a/Plugins/Flow.Launcher.Plugin.PluginsManager/Utilities.cs +++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/Utilities.cs @@ -71,9 +71,8 @@ namespace Flow.Launcher.Plugin.PluginsManager if (pluginJsonEntry != null) { - using StreamReader reader = new StreamReader(pluginJsonEntry.Open()); - string pluginJsonContent = reader.ReadToEnd(); - plugin = JsonSerializer.Deserialize(pluginJsonContent); + using Stream stream = pluginJsonEntry.Open(); + plugin = JsonSerializer.Deserialize(stream); plugin.IcoPath = "Images\\zipfolder.png"; } } From a9d77d8bcfa423b4b4db67cff8a8bc97a223ad3e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 10 Jan 2025 19:31:36 +0000 Subject: [PATCH 15/26] Bump Mages from 2.0.2 to 3.0.0 (#3154) --- .../Flow.Launcher.Plugin.Calculator.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Flow.Launcher.Plugin.Calculator.csproj b/Plugins/Flow.Launcher.Plugin.Calculator/Flow.Launcher.Plugin.Calculator.csproj index 69c03b877..1b985acf9 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Flow.Launcher.Plugin.Calculator.csproj +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Flow.Launcher.Plugin.Calculator.csproj @@ -62,7 +62,7 @@ - + \ No newline at end of file From 2de63f73a5bb3eb64a61a04ab190b39ab466d2f5 Mon Sep 17 00:00:00 2001 From: Hongtao Zhang Date: Fri, 10 Jan 2025 13:36:09 -0600 Subject: [PATCH 16/26] change equality related testing --- Flow.Launcher.Test/Plugins/JsonRPCPluginTest.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Flow.Launcher.Test/Plugins/JsonRPCPluginTest.cs b/Flow.Launcher.Test/Plugins/JsonRPCPluginTest.cs index 3d05e5679..b4e0736c6 100644 --- a/Flow.Launcher.Test/Plugins/JsonRPCPluginTest.cs +++ b/Flow.Launcher.Test/Plugins/JsonRPCPluginTest.cs @@ -78,8 +78,8 @@ namespace Flow.Launcher.Test.Plugins foreach (var ((result1, result2), referenceResult) in results1.Zip(results2).Zip(reference.Result)) { - Assert.AreEqual(result1, result2); - Assert.AreEqual(result1, referenceResult); + Assert.AreEqual(result1.Title, result2.Title); + Assert.AreEqual(result1.Title, referenceResult.Title); Assert.IsNotNull(result1); Assert.IsNotNull(result1.AsyncAction); From 43965f4751fc31f978ae272c22bc9dab703ed006 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Jan 2025 22:11:23 +0000 Subject: [PATCH 17/26] Bump BitFaster.Caching from 2.5.2 to 2.5.3 Bumps [BitFaster.Caching](https://github.com/bitfaster/BitFaster.Caching) from 2.5.2 to 2.5.3. - [Release notes](https://github.com/bitfaster/BitFaster.Caching/releases) - [Commits](https://github.com/bitfaster/BitFaster.Caching/compare/v2.5.2...v2.5.3) --- updated-dependencies: - dependency-name: BitFaster.Caching dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .../Flow.Launcher.Infrastructure.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Flow.Launcher.Infrastructure/Flow.Launcher.Infrastructure.csproj b/Flow.Launcher.Infrastructure/Flow.Launcher.Infrastructure.csproj index 1475252ca..1d6ee5c86 100644 --- a/Flow.Launcher.Infrastructure/Flow.Launcher.Infrastructure.csproj +++ b/Flow.Launcher.Infrastructure/Flow.Launcher.Infrastructure.csproj @@ -53,7 +53,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 8e5d77878af93e42de831b505a6c926e271917c0 Mon Sep 17 00:00:00 2001 From: Jeremy Wu Date: Sat, 18 Jan 2025 20:51:06 +1100 Subject: [PATCH 18/26] remove equality test --- .../Plugins/JsonRPCPluginTest.cs | 23 ------------------- 1 file changed, 23 deletions(-) diff --git a/Flow.Launcher.Test/Plugins/JsonRPCPluginTest.cs b/Flow.Launcher.Test/Plugins/JsonRPCPluginTest.cs index b4e0736c6..42a4630fe 100644 --- a/Flow.Launcher.Test/Plugins/JsonRPCPluginTest.cs +++ b/Flow.Launcher.Test/Plugins/JsonRPCPluginTest.cs @@ -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.Title, result2.Title); - Assert.AreEqual(result1.Title, referenceResult.Title); - - Assert.IsNotNull(result1); - Assert.IsNotNull(result1.AsyncAction); - } - } - } } From abe943b69339963dff909ecf5c8d9aaa6dc391ce Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Sat, 18 Jan 2025 18:39:44 +0800 Subject: [PATCH 19/26] Fix system language code fetch issue --- .../Resource/Internationalization.cs | 58 +++++++++---------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/Flow.Launcher.Core/Resource/Internationalization.cs b/Flow.Launcher.Core/Resource/Internationalization.cs index 70f23c897..13efdda56 100644 --- a/Flow.Launcher.Core/Resource/Internationalization.cs +++ b/Flow.Launcher.Core/Resource/Internationalization.cs @@ -23,19 +23,45 @@ namespace Flow.Launcher.Core.Resource private const string Extension = ".xaml"; private readonly List _languageDirectories = new List(); private readonly List _oldResources = new List(); + private readonly string SystemLanguageCode; public Internationalization() { AddFlowLauncherLanguageDirectory(); + SystemLanguageCode = GetSystemLanguageCode(); } - private void AddFlowLauncherLanguageDirectory() { var directory = Path.Combine(Constant.ProgramDirectory, Folder); _languageDirectories.Add(directory); } + private static string GetSystemLanguageCode() + { + var availableLanguages = AvailableLanguages.GetAvailableLanguages(); + + // Retrieve the language identifiers for the current culture + 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 plugins) { @@ -74,7 +100,7 @@ namespace Flow.Launcher.Core.Resource var isSystem = false; if (languageCode == Constant.SystemLanguageCode) { - languageCode = GetSystemLanguageCode(); + languageCode = SystemLanguageCode; isSystem = true; } @@ -178,36 +204,10 @@ namespace Flow.Launcher.Core.Resource public List LoadAvailableLanguages() { var list = AvailableLanguages.GetAvailableLanguages(); - list.Insert(0, new Language(Constant.SystemLanguageCode, AvailableLanguages.GetSystemTranslation(GetSystemLanguageCode()))); + list.Insert(0, new Language(Constant.SystemLanguageCode, AvailableLanguages.GetSystemTranslation(SystemLanguageCode))); return list; } - private string GetSystemLanguageCode() - { - var availableLanguages = AvailableLanguages.GetAvailableLanguages(); - - // Retrieve the language identifiers for the current culture - 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; - } - public string GetTranslation(string key) { var translation = Application.Current.TryFindResource(key); From d21b9362cf098c99030ba8a91fd545cf418c2991 Mon Sep 17 00:00:00 2001 From: Hongtao Zhang Date: Mon, 20 Jan 2025 09:14:28 -0600 Subject: [PATCH 20/26] do not try catch the error for jsonrpc v2 --- Flow.Launcher.Core/Plugin/JsonRPCPluginV2.cs | 45 ++++++-------------- 1 file changed, 12 insertions(+), 33 deletions(-) diff --git a/Flow.Launcher.Core/Plugin/JsonRPCPluginV2.cs b/Flow.Launcher.Core/Plugin/JsonRPCPluginV2.cs index 5a6633525..305b28150 100644 --- a/Flow.Launcher.Core/Plugin/JsonRPCPluginV2.cs +++ b/Flow.Launcher.Core/Plugin/JsonRPCPluginV2.cs @@ -26,54 +26,33 @@ namespace Flow.Launcher.Core.Plugin protected override async Task ExecuteResultAsync(JsonRPCResult result) { - try - { - var res = await RPC.InvokeAsync(result.JsonRPCAction.Method, - argument: result.JsonRPCAction.Parameters); + var res = await RPC.InvokeAsync(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 LoadContextMenus(Result selectedResult) { - try - { - var res = JTF.Run(() => RPC.InvokeWithCancellationAsync("context_menu", - new object[] { selectedResult.ContextData })); + var res = JTF.Run(() => RPC.InvokeWithCancellationAsync("context_menu", + new object[] { selectedResult.ContextData })); - var results = ParseResults(res); + var results = ParseResults(res); - return results; - } - catch - { - return new List(); - } + return results; } public override async Task> QueryAsync(Query query, CancellationToken token) { - try - { - var res = await RPC.InvokeWithCancellationAsync("query", - new object[] { query, Settings.Inner }, - token); + var res = await RPC.InvokeWithCancellationAsync("query", + new object[] { query, Settings.Inner }, + token); - var results = ParseResults(res); + var results = ParseResults(res); - return results; - } - catch - { - return new List(); - } + return results; } From 5d164293b915d9c5d924b739ea3e0f13ad386542 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Jan 2025 22:39:42 +0000 Subject: [PATCH 21/26] Bump FSharp.Core from 9.0.100 to 9.0.101 Bumps [FSharp.Core](https://github.com/dotnet/fsharp) from 9.0.100 to 9.0.101. - [Release notes](https://github.com/dotnet/fsharp/releases) - [Changelog](https://github.com/dotnet/fsharp/blob/main/release-notes.md) - [Commits](https://github.com/dotnet/fsharp/commits) --- updated-dependencies: - dependency-name: FSharp.Core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Flow.Launcher.Core/Flow.Launcher.Core.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Flow.Launcher.Core/Flow.Launcher.Core.csproj b/Flow.Launcher.Core/Flow.Launcher.Core.csproj index 8aeca4699..df2f4d2cb 100644 --- a/Flow.Launcher.Core/Flow.Launcher.Core.csproj +++ b/Flow.Launcher.Core/Flow.Launcher.Core.csproj @@ -54,7 +54,7 @@ - + From fec553c87ca451d2d5cac3e1e71998e702fe8b8c Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Fri, 24 Jan 2025 12:11:48 +0800 Subject: [PATCH 22/26] Improve uninstaller check function --- Plugins/Flow.Launcher.Plugin.Program/Main.cs | 39 +++++++++++++++++--- 1 file changed, 33 insertions(+), 6 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Program/Main.cs b/Plugins/Flow.Launcher.Plugin.Program/Main.cs index e311a0b94..5ccccc24e 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.Program/Main.cs @@ -41,9 +41,13 @@ 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", + "卸载" + }; + private const string ExeUninstallerSuffix = ".exe"; + private const string InkUninstallerSuffix = ".lnk"; static Main() { @@ -96,10 +100,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 ink 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) From 71dad9f35616b0d0f6f2a3df4c7dca5791ec17ba Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Fri, 24 Jan 2025 18:35:11 +0800 Subject: [PATCH 23/26] Add support for more uninstaller prefixs --- Plugins/Flow.Launcher.Plugin.Program/Main.cs | 27 ++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Program/Main.cs b/Plugins/Flow.Launcher.Plugin.Program/Main.cs index 5ccccc24e..511794f89 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.Program/Main.cs @@ -43,8 +43,31 @@ namespace Flow.Launcher.Plugin.Program }; private static readonly string[] commonUninstallerPrefixs = { - "uninstall", - "卸载" + "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"; From 0c7dc07c743df01bce72c001061ede34b9b0fc08 Mon Sep 17 00:00:00 2001 From: Jeremy Wu Date: Sun, 26 Jan 2025 09:34:07 +1100 Subject: [PATCH 24/26] fix typo --- Plugins/Flow.Launcher.Plugin.Program/Main.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Flow.Launcher.Plugin.Program/Main.cs b/Plugins/Flow.Launcher.Plugin.Program/Main.cs index 511794f89..00b97e114 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.Program/Main.cs @@ -136,7 +136,7 @@ namespace Flow.Launcher.Plugin.Program return false; } - // Second check the ink path + // Second check the lnk path if (!string.IsNullOrEmpty(win32.LnkResolvedPath)) { var inkFileName = Path.GetFileName(win32.FullPath); From 0e700cdfcc5aced08e75e19c38f33836d7276628 Mon Sep 17 00:00:00 2001 From: Jeremy Date: Sun, 26 Jan 2025 10:42:32 +1100 Subject: [PATCH 25/26] rename GetSystemLanguageCode method + add comment --- Flow.Launcher.Core/Resource/Internationalization.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Flow.Launcher.Core/Resource/Internationalization.cs b/Flow.Launcher.Core/Resource/Internationalization.cs index 13efdda56..ef38e8be0 100644 --- a/Flow.Launcher.Core/Resource/Internationalization.cs +++ b/Flow.Launcher.Core/Resource/Internationalization.cs @@ -28,7 +28,7 @@ namespace Flow.Launcher.Core.Resource public Internationalization() { AddFlowLauncherLanguageDirectory(); - SystemLanguageCode = GetSystemLanguageCode(); + SystemLanguageCode = GetSystemLanguageCodeAtStartup(); } private void AddFlowLauncherLanguageDirectory() @@ -37,11 +37,13 @@ namespace Flow.Launcher.Core.Resource _languageDirectories.Add(directory); } - private static string GetSystemLanguageCode() + private static string GetSystemLanguageCodeAtStartup() { var availableLanguages = AvailableLanguages.GetAvailableLanguages(); - // Retrieve the language identifiers for the current culture + // 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; From 1c7e29013e96efb1abecdb3bb9f1a2043017b49c Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Mon, 27 Jan 2025 09:11:27 +0800 Subject: [PATCH 26/26] Fix setting window freeze issue & Improve singleton window opener --- Flow.Launcher/Helper/SingletonWindowOpener.cs | 21 +++++++++++++++---- Flow.Launcher/SettingWindow.xaml.cs | 4 ++-- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/Flow.Launcher/Helper/SingletonWindowOpener.cs b/Flow.Launcher/Helper/SingletonWindowOpener.cs index b5c2d8b55..5282b61f9 100644 --- a/Flow.Launcher/Helper/SingletonWindowOpener.cs +++ b/Flow.Launcher/Helper/SingletonWindowOpener.cs @@ -10,16 +10,29 @@ public static class SingletonWindowOpener { var window = Application.Current.Windows.OfType().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; diff --git a/Flow.Launcher/SettingWindow.xaml.cs b/Flow.Launcher/SettingWindow.xaml.cs index cb3f1e4a1..d5b303516 100644 --- a/Flow.Launcher/SettingWindow.xaml.cs +++ b/Flow.Launcher/SettingWindow.xaml.cs @@ -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(); }