Skip to content

Commit 71b8144

Browse files
committed
Add translations & Improve code quality
1 parent bfd10f6 commit 71b8144

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

Flow.Launcher/Languages/en.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,7 @@
590590
<system:String x:Key="errorTitle">Error</system:String>
591591
<system:String x:Key="folderOpenError">An error occurred while opening the folder. {0}</system:String>
592592
<system:String x:Key="browserOpenError">An error occurred while opening the URL in the browser. Please check your Default Web Browser configuration in the General section of the settings window</system:String>
593+
<system:String x:Key="fileNotFoundError">File or directory not found: {0}</system:String>
593594

594595
<!-- General Notice -->
595596
<system:String x:Key="pleaseWait">Please wait...</system:String>

Flow.Launcher/PublicAPIInstance.cs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Collections.Concurrent;
33
using System.Collections.Generic;
44
using System.Collections.Specialized;
@@ -412,14 +412,12 @@ public void OpenDirectory(string directoryPath, string fileNameOrFilePath = null
412412

413413
private void OpenUri(Uri uri, bool? inPrivate = null, bool forceBrowser = false)
414414
{
415-
if (uri.IsFile)
415+
if (uri.IsFile && !File.Exists(uri.LocalPath) && !Directory.Exists(uri.LocalPath))
416416
{
417-
if (!File.Exists(uri.LocalPath) && !Directory.Exists(uri.LocalPath))
418-
{
419-
ShowMsgError(GetTranslation("errorTitle"), $"File or directory not found: {uri.LocalPath}");
420-
return;
421-
}
417+
ShowMsgError(GetTranslation("errorTitle"), string.Format(GetTranslation("fileNotFoundError"), uri.LocalPath));
418+
return;
422419
}
420+
423421
if (forceBrowser || uri.Scheme == Uri.UriSchemeHttp || uri.Scheme == Uri.UriSchemeHttps)
424422
{
425423
var browserInfo = _settings.CustomBrowser;

0 commit comments

Comments
 (0)