From 87597625d59b9d4fad70c1687c7ddcec42148f3b Mon Sep 17 00:00:00 2001 From: Vic <10308169+VictoriousRaptor@users.noreply.github.com> Date: Fri, 23 Dec 2022 14:58:13 +0800 Subject: [PATCH 1/2] Remove Segoe UI to fix Chinese font --- Flow.Launcher/CustomShortcutSetting.xaml | 1 - 1 file changed, 1 deletion(-) diff --git a/Flow.Launcher/CustomShortcutSetting.xaml b/Flow.Launcher/CustomShortcutSetting.xaml index bbf6ff9f239..5a40a77b12e 100644 --- a/Flow.Launcher/CustomShortcutSetting.xaml +++ b/Flow.Launcher/CustomShortcutSetting.xaml @@ -64,7 +64,6 @@ Date: Fri, 23 Dec 2022 15:15:11 +0800 Subject: [PATCH 2/2] Fix hardcoded strings --- .../Languages/en.xaml | 5 +++++ .../Search/ResultManager.cs | 22 +++++-------------- 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml index 94b46b2305c..265b26296ba 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml @@ -99,6 +99,11 @@ Remove from Quick Access Remove current result from Quick Access Show Windows Context Menu + + + {0} free of {1} + Open in Default File Manager + Use '>' to search in this directory, '*' to search for file extensions or '>*' to combine both searches. Failed to load Everything SDK diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs index 88bfecc14fb..214a779e4ab 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs @@ -96,7 +96,9 @@ internal static Result CreateDriveSpaceDisplayResult(string path, string actionK var driveLetter = path[..1].ToUpper(); var driveName = driveLetter + ":\\"; DriveInfo drv = new DriveInfo(driveLetter); - var subtitle = ToReadableSize(drv.AvailableFreeSpace, 2) + " free of " + ToReadableSize(drv.TotalSize, 2); + var freespace = ToReadableSize(drv.AvailableFreeSpace, 2); + var totalspace = ToReadableSize(drv.TotalSize, 2); + var subtitle = string.Format(Context.API.GetTranslation("plugin_explorer_diskfreespace"), freespace, totalspace); double usingSize = (Convert.ToDouble(drv.TotalSize) - Convert.ToDouble(drv.AvailableFreeSpace)) / Convert.ToDouble(drv.TotalSize) * 100; int? progressValue = Convert.ToInt32(usingSize); @@ -170,25 +172,11 @@ internal static Result CreateOpenCurrentFolderResult(string path, string actionK // Path passed from PathSearchAsync ends with Constants.DirectorySeperator ('\'), need to remove the seperator // so it's consistent with folder results returned by index search which does not end with one var folderPath = path.TrimEnd(Constants.DirectorySeperator); - - var folderName = folderPath.TrimEnd(Constants.DirectorySeperator).Split(new[] - { - Path.DirectorySeparatorChar - }, StringSplitOptions.None).Last(); - - var title = $"Open {folderName}"; - - var subtitleFolderName = folderName; - - // ie. max characters can be displayed without subtitle cutting off: "Program Files (x86)" - if (folderName.Length > 19) - subtitleFolderName = "the directory"; return new Result { - Title = title, - SubTitle = $"Use > to search within {subtitleFolderName}, " + - $"* to search for file extensions or >* to combine both searches.", + Title = Context.API.GetTranslation("plugin_explorer_openresultfolder"), + SubTitle = Context.API.GetTranslation("plugin_explorer_openresultfolder_subtitle"), AutoCompleteText = GetPathWithActionKeyword(folderPath, ResultType.Folder, actionKeyword), IcoPath = folderPath, Score = 500,