Skip to content

Commit 5a5d407

Browse files
Merge pull request #1713 from VictoriousRaptor/Fix1705
Fix 1705
2 parents e94929a + 552786b commit 5a5d407

File tree

3 files changed

+10
-18
lines changed

3 files changed

+10
-18
lines changed

Flow.Launcher/CustomShortcutSetting.xaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@
6464
<TextBlock
6565
Grid.Column="0"
6666
Margin="0,0,0,0"
67-
FontFamily="Segoe UI"
6867
FontSize="20"
6968
FontWeight="SemiBold"
7069
Text="{DynamicResource customQueryShortcut}"

Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,11 @@
9999
<system:String x:Key="plugin_explorer_remove_from_quickaccess_title">Remove from Quick Access</system:String>
100100
<system:String x:Key="plugin_explorer_remove_from_quickaccess_subtitle">Remove current item from Quick Access</system:String>
101101
<system:String x:Key="plugin_explorer_show_contextmenu_title">Show Windows Context Menu</system:String>
102+
103+
<!-- Special Results-->
104+
<system:String x:Key="plugin_explorer_diskfreespace">{0} free of {1}</system:String>
105+
<system:String x:Key="plugin_explorer_openresultfolder">Open in Default File Manager</system:String>
106+
<system:String x:Key="plugin_explorer_openresultfolder_subtitle">Use '>' to search in this directory, '*' to search for file extensions or '>*' to combine both searches.</system:String>
102107

103108
<!-- Everything -->
104109
<system:String x:Key="flowlauncher_plugin_everything_sdk_issue">Failed to load Everything SDK</system:String>

Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@ internal static Result CreateDriveSpaceDisplayResult(string path, string actionK
9696
var driveLetter = path[..1].ToUpper();
9797
var driveName = driveLetter + ":\\";
9898
DriveInfo drv = new DriveInfo(driveLetter);
99-
var subtitle = ToReadableSize(drv.AvailableFreeSpace, 2) + " free of " + ToReadableSize(drv.TotalSize, 2);
99+
var freespace = ToReadableSize(drv.AvailableFreeSpace, 2);
100+
var totalspace = ToReadableSize(drv.TotalSize, 2);
101+
var subtitle = string.Format(Context.API.GetTranslation("plugin_explorer_diskfreespace"), freespace, totalspace);
100102
double usingSize = (Convert.ToDouble(drv.TotalSize) - Convert.ToDouble(drv.AvailableFreeSpace)) / Convert.ToDouble(drv.TotalSize) * 100;
101103

102104
int? progressValue = Convert.ToInt32(usingSize);
@@ -170,25 +172,11 @@ internal static Result CreateOpenCurrentFolderResult(string path, string actionK
170172
// Path passed from PathSearchAsync ends with Constants.DirectorySeperator ('\'), need to remove the seperator
171173
// so it's consistent with folder results returned by index search which does not end with one
172174
var folderPath = path.TrimEnd(Constants.DirectorySeperator);
173-
174-
var folderName = folderPath.TrimEnd(Constants.DirectorySeperator).Split(new[]
175-
{
176-
Path.DirectorySeparatorChar
177-
}, StringSplitOptions.None).Last();
178-
179-
var title = $"Open {folderName}";
180-
181-
var subtitleFolderName = folderName;
182-
183-
// ie. max characters can be displayed without subtitle cutting off: "Program Files (x86)"
184-
if (folderName.Length > 19)
185-
subtitleFolderName = "the directory";
186175

187176
return new Result
188177
{
189-
Title = title,
190-
SubTitle = $"Use > to search within {subtitleFolderName}, " +
191-
$"* to search for file extensions or >* to combine both searches.",
178+
Title = Context.API.GetTranslation("plugin_explorer_openresultfolder"),
179+
SubTitle = Context.API.GetTranslation("plugin_explorer_openresultfolder_subtitle"),
192180
AutoCompleteText = GetPathWithActionKeyword(folderPath, ResultType.Folder, actionKeyword),
193181
IcoPath = folderPath,
194182
Score = 500,

0 commit comments

Comments
 (0)