From f37d4c47ccf8a211a3fe78ba239b9bc381e541fb Mon Sep 17 00:00:00 2001 From: Jeremy Wu Date: Tue, 14 Oct 2025 21:49:29 +1100 Subject: [PATCH] Release 2.0.2 | Plugin 5.1.0 (#4046) --- .../NativeMethods.txt | 7 +- .../UserSettings/DataLocation.cs | 7 +- Flow.Launcher.Infrastructure/Win32Helper.cs | 104 +++++++++++- .../Flow.Launcher.Plugin.csproj | 8 +- .../SharedCommands/FilesFolders.cs | 10 ++ Flow.Launcher/Languages/ar.xaml | 5 +- Flow.Launcher/Languages/cs.xaml | 5 +- Flow.Launcher/Languages/da.xaml | 5 +- Flow.Launcher/Languages/de.xaml | 5 +- Flow.Launcher/Languages/en.xaml | 1 + Flow.Launcher/Languages/es-419.xaml | 5 +- Flow.Launcher/Languages/es.xaml | 13 +- Flow.Launcher/Languages/fr.xaml | 5 +- Flow.Launcher/Languages/he.xaml | 5 +- Flow.Launcher/Languages/it.xaml | 5 +- Flow.Launcher/Languages/ja.xaml | 15 +- Flow.Launcher/Languages/ko.xaml | 5 +- Flow.Launcher/Languages/nb.xaml | 5 +- Flow.Launcher/Languages/nl.xaml | 5 +- Flow.Launcher/Languages/pl.xaml | 37 +++-- Flow.Launcher/Languages/pt-br.xaml | 5 +- Flow.Launcher/Languages/pt-pt.xaml | 5 +- Flow.Launcher/Languages/ru.xaml | 5 +- Flow.Launcher/Languages/sk.xaml | 5 +- Flow.Launcher/Languages/sr-Cyrl-RS.xaml | 5 +- Flow.Launcher/Languages/sr.xaml | 5 +- Flow.Launcher/Languages/tr.xaml | 15 +- Flow.Launcher/Languages/uk-UA.xaml | 5 +- Flow.Launcher/Languages/vi.xaml | 5 +- Flow.Launcher/Languages/zh-cn.xaml | 7 +- Flow.Launcher/Languages/zh-tw.xaml | 5 +- Flow.Launcher/MainWindow.xaml.cs | 101 ++++++++---- Flow.Launcher/PublicAPIInstance.cs | 35 ++-- .../SettingsPaneGeneralViewModel.cs | 2 +- .../ViewModels/SettingsPaneHotkeyViewModel.cs | 14 +- ...low.Launcher.Plugin.BrowserBookmark.csproj | 6 +- .../DecimalSeparator.cs | 6 +- .../Flow.Launcher.Plugin.Calculator.csproj | 2 +- .../Languages/es.xaml | 4 +- .../Languages/ja.xaml | 4 +- .../Flow.Launcher.Plugin.Calculator/Main.cs | 20 +-- .../Settings.cs | 3 +- .../ContextMenu.cs | 114 ++++++-------- .../Flow.Launcher.Plugin.Explorer.csproj | 2 +- .../Languages/en.xaml | 1 + .../Languages/es.xaml | 2 +- .../Languages/fr.xaml | 2 +- .../Languages/tr.xaml | 4 +- .../Languages/zh-cn.xaml | 2 +- Plugins/Flow.Launcher.Plugin.Explorer/Main.cs | 4 +- .../Everything/EverythingDownloadHelper.cs | 15 +- .../Everything/EverythingSearchManager.cs | 14 +- .../Search/ResultManager.cs | 29 ++-- .../Search/SearchManager.cs | 4 +- .../WindowsIndex/WindowsIndexSearchManager.cs | 4 +- .../Flow.Launcher.Plugin.Explorer/Settings.cs | 9 +- .../ViewModels/SettingsViewModel.cs | 12 +- .../Views/ActionKeywordSetting.xaml.cs | 12 +- .../Views/PreviewPanel.xaml.cs | 59 ++++--- .../Views/QuickAccessLinkSettings.xaml.cs | 4 +- ...low.Launcher.Plugin.PluginIndicator.csproj | 5 + .../Main.cs | 34 ++-- .../Flow.Launcher.Plugin.ProcessKiller.csproj | 2 + .../Main.cs | 64 ++++---- .../ProcessHelper.cs | 16 +- .../ProcessResult.cs | 21 +-- .../ViewModels/SettingsViewModel.cs | 21 +-- .../Views/SettingsControl.xaml | 6 +- .../Views/SettingsControl.xaml.cs | 3 - .../Languages/tr.xaml | 6 +- ...nOrCloseShellAfterPressEnabledConverter.cs | 25 +++ .../Flow.Launcher.Plugin.Shell.csproj | 2 + Plugins/Flow.Launcher.Plugin.Shell/Main.cs | 62 ++++---- .../Flow.Launcher.Plugin.Shell/Settings.cs | 135 ++++++++++++++-- .../ShellSetting.xaml.cs | 143 ----------------- .../ViewModels/ShellSettingViewModel.cs | 78 +++++++++ .../{ => Views}/ShellSetting.xaml | 58 +++++-- .../Views/ShellSetting.xaml.cs | 15 ++ .../CommandKeywordSetting.xaml.cs | 10 +- .../Flow.Launcher.Plugin.Sys.csproj | 2 + .../Languages/ar.xaml | 5 + .../Languages/cs.xaml | 5 + .../Languages/da.xaml | 5 + .../Languages/de.xaml | 5 + .../Languages/en.xaml | 5 + .../Languages/es-419.xaml | 5 + .../Languages/es.xaml | 5 + .../Languages/fr.xaml | 5 + .../Languages/he.xaml | 5 + .../Languages/it.xaml | 5 + .../Languages/ja.xaml | 7 +- .../Languages/ko.xaml | 5 + .../Languages/nb.xaml | 5 + .../Languages/nl.xaml | 5 + .../Languages/pl.xaml | 5 + .../Languages/pt-br.xaml | 5 + .../Languages/pt-pt.xaml | 5 + .../Languages/ru.xaml | 5 + .../Languages/sk.xaml | 5 + .../Languages/sr-Cyrl-RS.xaml | 5 + .../Languages/sr.xaml | 5 + .../Languages/tr.xaml | 5 + .../Languages/uk-UA.xaml | 5 + .../Languages/vi.xaml | 5 + .../Languages/zh-cn.xaml | 5 + .../Languages/zh-tw.xaml | 5 + Plugins/Flow.Launcher.Plugin.Sys/Main.cs | 149 +++++++++--------- Plugins/Flow.Launcher.Plugin.Sys/Settings.cs | 6 +- .../SettingsViewModel.cs | 9 +- .../SysSettings.xaml.cs | 11 +- .../Flow.Launcher.Plugin.Sys/ThemeSelector.cs | 61 +++---- .../Flow.Launcher.Plugin.Url.csproj | 5 + .../Languages/ar.xaml | 15 +- .../Languages/cs.xaml | 15 +- .../Languages/da.xaml | 15 +- .../Languages/de.xaml | 15 +- .../Languages/es-419.xaml | 15 +- .../Languages/es.xaml | 15 +- .../Languages/fr.xaml | 15 +- .../Languages/he.xaml | 15 +- .../Languages/it.xaml | 15 +- .../Languages/ja.xaml | 15 +- .../Languages/ko.xaml | 15 +- .../Languages/nb.xaml | 15 +- .../Languages/nl.xaml | 15 +- .../Languages/pl.xaml | 15 +- .../Languages/pt-br.xaml | 15 +- .../Languages/pt-pt.xaml | 15 +- .../Languages/ru.xaml | 15 +- .../Languages/sk.xaml | 15 +- .../Languages/sr-Cyrl-RS.xaml | 15 +- .../Languages/sr.xaml | 15 +- .../Languages/tr.xaml | 15 +- .../Languages/uk-UA.xaml | 15 +- .../Languages/vi.xaml | 15 +- .../Languages/zh-cn.xaml | 15 +- .../Languages/zh-tw.xaml | 15 +- Plugins/Flow.Launcher.Plugin.Url/Main.cs | 14 +- .../Languages/ar.xaml | 1 + .../Languages/cs.xaml | 1 + .../Languages/da.xaml | 1 + .../Languages/de.xaml | 1 + .../Languages/en.xaml | 1 + .../Languages/es-419.xaml | 1 + .../Languages/es.xaml | 1 + .../Languages/fr.xaml | 1 + .../Languages/he.xaml | 1 + .../Languages/it.xaml | 1 + .../Languages/ja.xaml | 1 + .../Languages/ko.xaml | 1 + .../Languages/nb.xaml | 1 + .../Languages/nl.xaml | 1 + .../Languages/pl.xaml | 1 + .../Languages/pt-br.xaml | 1 + .../Languages/pt-pt.xaml | 1 + .../Languages/ru.xaml | 1 + .../Languages/sk.xaml | 1 + .../Languages/sr-Cyrl-RS.xaml | 1 + .../Languages/sr.xaml | 1 + .../Languages/tr.xaml | 1 + .../Languages/uk-UA.xaml | 1 + .../Languages/vi.xaml | 1 + .../Languages/zh-cn.xaml | 1 + .../Languages/zh-tw.xaml | 1 + .../SearchSourceSetting.xaml.cs | 16 +- .../Properties/Resources.ko-KR.resx | 32 ++-- appveyor.yml | 2 +- 167 files changed, 1487 insertions(+), 873 deletions(-) create mode 100644 Plugins/Flow.Launcher.Plugin.Shell/Converters/LeaveShellOpenOrCloseShellAfterPressEnabledConverter.cs delete mode 100644 Plugins/Flow.Launcher.Plugin.Shell/ShellSetting.xaml.cs create mode 100644 Plugins/Flow.Launcher.Plugin.Shell/ViewModels/ShellSettingViewModel.cs rename Plugins/Flow.Launcher.Plugin.Shell/{ => Views}/ShellSetting.xaml (53%) create mode 100644 Plugins/Flow.Launcher.Plugin.Shell/Views/ShellSetting.xaml.cs diff --git a/Flow.Launcher.Infrastructure/NativeMethods.txt b/Flow.Launcher.Infrastructure/NativeMethods.txt index eb844dd7c..cd072f635 100644 --- a/Flow.Launcher.Infrastructure/NativeMethods.txt +++ b/Flow.Launcher.Infrastructure/NativeMethods.txt @@ -85,5 +85,10 @@ QueryFullProcessImageName EVENT_OBJECT_HIDE EVENT_SYSTEM_DIALOGEND +DEVICE_NOTIFY_SUBSCRIBE_PARAMETERS WM_POWERBROADCAST -PBT_APMRESUMEAUTOMATIC \ No newline at end of file +PBT_APMRESUMEAUTOMATIC +PBT_APMRESUMESUSPEND +PowerRegisterSuspendResumeNotification +PowerUnregisterSuspendResumeNotification +DeviceNotifyCallbackRoutine \ No newline at end of file diff --git a/Flow.Launcher.Infrastructure/UserSettings/DataLocation.cs b/Flow.Launcher.Infrastructure/UserSettings/DataLocation.cs index 5b948e450..de9cb841e 100644 --- a/Flow.Launcher.Infrastructure/UserSettings/DataLocation.cs +++ b/Flow.Launcher.Infrastructure/UserSettings/DataLocation.cs @@ -7,8 +7,8 @@ namespace Flow.Launcher.Infrastructure.UserSettings { public const string PortableFolderName = "UserData"; public const string DeletionIndicatorFile = ".dead"; - public static string PortableDataPath = Path.Combine(Constant.ProgramDirectory, PortableFolderName); - public static string RoamingDataPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "FlowLauncher"); + public static readonly string PortableDataPath = Path.Combine(Constant.ProgramDirectory, PortableFolderName); + public static readonly string RoamingDataPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "FlowLauncher"); public static string DataDirectory() { if (PortableDataLocationInUse()) @@ -19,7 +19,8 @@ namespace Flow.Launcher.Infrastructure.UserSettings public static bool PortableDataLocationInUse() { - if (Directory.Exists(PortableDataPath) && !File.Exists(DeletionIndicatorFile)) + if (Directory.Exists(PortableDataPath) && + !File.Exists(Path.Combine(PortableDataPath, DeletionIndicatorFile))) return true; return false; diff --git a/Flow.Launcher.Infrastructure/Win32Helper.cs b/Flow.Launcher.Infrastructure/Win32Helper.cs index 5d30b740d..8a41e12b4 100644 --- a/Flow.Launcher.Infrastructure/Win32Helper.cs +++ b/Flow.Launcher.Infrastructure/Win32Helper.cs @@ -19,6 +19,7 @@ using Microsoft.Win32.SafeHandles; using Windows.Win32; using Windows.Win32.Foundation; using Windows.Win32.Graphics.Dwm; +using Windows.Win32.System.Power; using Windows.Win32.System.Threading; using Windows.Win32.UI.Input.KeyboardAndMouse; using Windows.Win32.UI.Shell.Common; @@ -338,9 +339,6 @@ namespace Flow.Launcher.Infrastructure public const int SC_MAXIMIZE = (int)PInvoke.SC_MAXIMIZE; public const int SC_MINIMIZE = (int)PInvoke.SC_MINIMIZE; - public const int WM_POWERBROADCAST = (int)PInvoke.WM_POWERBROADCAST; - public const int PBT_APMRESUMEAUTOMATIC = (int)PInvoke.PBT_APMRESUMEAUTOMATIC; - #endregion #region Window Handle @@ -918,5 +916,105 @@ namespace Flow.Launcher.Infrastructure } #endregion + + #region Sleep Mode Listener + + private static Action _func; + private static PDEVICE_NOTIFY_CALLBACK_ROUTINE _callback = null; + private static DEVICE_NOTIFY_SUBSCRIBE_PARAMETERS _recipient; + private static SafeHandle _recipientHandle; + private static HPOWERNOTIFY _handle = HPOWERNOTIFY.Null; + + /// + /// Registers a listener for sleep mode events. + /// Inspired from: https://github.com/XKaguya/LenovoLegionToolkit + /// https://blog.csdn.net/mochounv/article/details/114668594 + /// + /// + /// + public static unsafe void RegisterSleepModeListener(Action func) + { + if (_callback != null) + { + // Only register if not already registered + return; + } + + _func = func; + _callback = new PDEVICE_NOTIFY_CALLBACK_ROUTINE(DeviceNotifyCallback); + _recipient = new DEVICE_NOTIFY_SUBSCRIBE_PARAMETERS() + { + Callback = _callback, + Context = null + }; + + _recipientHandle = new StructSafeHandle(_recipient); + _handle = PInvoke.PowerRegisterSuspendResumeNotification( + REGISTER_NOTIFICATION_FLAGS.DEVICE_NOTIFY_CALLBACK, + _recipientHandle, + out var handle) == WIN32_ERROR.ERROR_SUCCESS ? + new HPOWERNOTIFY(new IntPtr(handle)) : + HPOWERNOTIFY.Null; + if (_handle.IsNull) + { + throw new Win32Exception("Error registering for power notifications: " + Marshal.GetLastWin32Error()); + } + } + + /// + /// Unregisters the sleep mode listener. + /// + public static void UnregisterSleepModeListener() + { + if (!_handle.IsNull) + { + PInvoke.PowerUnregisterSuspendResumeNotification(_handle); + _handle = HPOWERNOTIFY.Null; + _func = null; + _callback = null; + _recipientHandle = null; + } + } + + private static unsafe uint DeviceNotifyCallback(void* context, uint type, void* setting) + { + switch (type) + { + case PInvoke.PBT_APMRESUMEAUTOMATIC: + // Operation is resuming automatically from a low-power state.This message is sent every time the system resumes + _func?.Invoke(); + break; + + case PInvoke.PBT_APMRESUMESUSPEND: + // Operation is resuming from a low-power state.This message is sent after PBT_APMRESUMEAUTOMATIC if the resume is triggered by user input, such as pressing a key + _func?.Invoke(); + break; + } + + return 0; + } + + private sealed class StructSafeHandle : SafeHandle where T : struct + { + private readonly nint _ptr = nint.Zero; + + public StructSafeHandle(T recipient) : base(nint.Zero, true) + { + var pRecipient = Marshal.AllocHGlobal(Marshal.SizeOf()); + Marshal.StructureToPtr(recipient, pRecipient, false); + SetHandle(pRecipient); + _ptr = pRecipient; + } + + public override bool IsInvalid => handle == nint.Zero; + + protected override bool ReleaseHandle() + { + Marshal.FreeHGlobal(_ptr); + return true; + } + } + + #endregion } } diff --git a/Flow.Launcher.Plugin/Flow.Launcher.Plugin.csproj b/Flow.Launcher.Plugin/Flow.Launcher.Plugin.csproj index 1ae0b1f58..649d59ad7 100644 --- a/Flow.Launcher.Plugin/Flow.Launcher.Plugin.csproj +++ b/Flow.Launcher.Plugin/Flow.Launcher.Plugin.csproj @@ -15,10 +15,10 @@ - 5.0.0 - 5.0.0 - 5.0.0 - 5.0.0 + 5.1.0 + 5.1.0 + 5.1.0 + 5.1.0 Flow.Launcher.Plugin Flow-Launcher MIT diff --git a/Flow.Launcher.Plugin/SharedCommands/FilesFolders.cs b/Flow.Launcher.Plugin/SharedCommands/FilesFolders.cs index 6c506cfc0..3af57f00d 100644 --- a/Flow.Launcher.Plugin/SharedCommands/FilesFolders.cs +++ b/Flow.Launcher.Plugin/SharedCommands/FilesFolders.cs @@ -150,6 +150,16 @@ namespace Flow.Launcher.Plugin.SharedCommands return File.Exists(filePath); } + /// + /// Checks if a file or directory exists + /// + /// + /// + public static bool FileOrLocationExists(this string path) + { + return LocationExists(path) || FileExists(path); + } + /// /// Open a directory window (using the OS's default handler, usually explorer) /// diff --git a/Flow.Launcher/Languages/ar.xaml b/Flow.Launcher/Languages/ar.xaml index b8845c3f5..7dcfcdb09 100644 --- a/Flow.Launcher/Languages/ar.xaml +++ b/Flow.Launcher/Languages/ar.xaml @@ -214,6 +214,8 @@ الإصدار الموقع الإلكتروني إلغاء التثبيت + Search delay time: default + Search delay time: {0}ms Fail to remove plugin settings Plugins: {0} - Fail to remove plugin settings files, please remove them manually Fail to remove plugin cache @@ -595,8 +597,9 @@ The specified file manager could not be found. Please check the Custom File Manager setting under Settings > General. خطأ - An error occurred while opening the folder. {0} + An error occurred while opening the folder. 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 + File or directory not found: {0} يرجى الانتظار... diff --git a/Flow.Launcher/Languages/cs.xaml b/Flow.Launcher/Languages/cs.xaml index 30a1cdbb9..d08653a04 100644 --- a/Flow.Launcher/Languages/cs.xaml +++ b/Flow.Launcher/Languages/cs.xaml @@ -214,6 +214,8 @@ Verze Webová stránka Odinstalovat + Search delay time: default + Search delay time: {0}ms Fail to remove plugin settings Plugins: {0} - Fail to remove plugin settings files, please remove them manually Fail to remove plugin cache @@ -595,8 +597,9 @@ Pokud před zkratku při zadávání přidáte znak "@", bude odpovíd The specified file manager could not be found. Please check the Custom File Manager setting under Settings > General. Chyba - An error occurred while opening the folder. {0} + An error occurred while opening the folder. 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 + File or directory not found: {0} Počkejte prosím... diff --git a/Flow.Launcher/Languages/da.xaml b/Flow.Launcher/Languages/da.xaml index 067ea16fc..7ad686fe8 100644 --- a/Flow.Launcher/Languages/da.xaml +++ b/Flow.Launcher/Languages/da.xaml @@ -214,6 +214,8 @@ Version Hjemmeside Uninstall + Search delay time: default + Search delay time: {0}ms Fail to remove plugin settings Plugins: {0} - Fail to remove plugin settings files, please remove them manually Fail to remove plugin cache @@ -595,8 +597,9 @@ If you add an '@' prefix while inputting a shortcut, it matches any position in The specified file manager could not be found. Please check the Custom File Manager setting under Settings > General. Error - An error occurred while opening the folder. {0} + An error occurred while opening the folder. 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 + File or directory not found: {0} Please wait... diff --git a/Flow.Launcher/Languages/de.xaml b/Flow.Launcher/Languages/de.xaml index 529531b58..064ac4038 100644 --- a/Flow.Launcher/Languages/de.xaml +++ b/Flow.Launcher/Languages/de.xaml @@ -214,6 +214,8 @@ Version Website Deinstallieren + Search delay time: default + Search delay time: {0}ms Plug-in-Einstellungen können nicht entfernt werden Plug-ins: {0} - Plug-in-Einstellungsdateien können nicht entfernt werden, bitte entfernen Sie diese manuell Plug-in-Cache kann nicht entfernt werden @@ -595,8 +597,9 @@ Wenn Sie bei der Eingabe eines Shortcuts ein '@'-Präfix hinzufügen, stimmt die Der spezifizierte Dateimanager konnte nicht gefunden werden. Bitte überprüfen Sie die Einstellung des benutzerdefinierten Dateimanagers unter Einstellungen > Allgemein. Fehler - Beim Öffnen des Ordners ist ein Fehler aufgetreten. {0} + An error occurred while opening the folder. Beim Öffnen der URL im Browser ist ein Fehler aufgetreten. Bitte überprüfen Sie die Konfiguration Ihres Default-Webbrowsers im Abschnitt „Allgemein“ des Einstellungsfensters + File or directory not found: {0} Bitte warten Sie ... diff --git a/Flow.Launcher/Languages/en.xaml b/Flow.Launcher/Languages/en.xaml index fba57a593..4f60b3750 100644 --- a/Flow.Launcher/Languages/en.xaml +++ b/Flow.Launcher/Languages/en.xaml @@ -587,6 +587,7 @@ Error An error occurred while opening the folder. {0} 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 + File or directory not found: {0} Please wait... diff --git a/Flow.Launcher/Languages/es-419.xaml b/Flow.Launcher/Languages/es-419.xaml index e18cdb3fe..8554f3847 100644 --- a/Flow.Launcher/Languages/es-419.xaml +++ b/Flow.Launcher/Languages/es-419.xaml @@ -214,6 +214,8 @@ Versión Sitio web Uninstall + Search delay time: default + Search delay time: {0}ms Fail to remove plugin settings Plugins: {0} - Fail to remove plugin settings files, please remove them manually Fail to remove plugin cache @@ -595,8 +597,9 @@ If you add an '@' prefix while inputting a shortcut, it matches any position in The specified file manager could not be found. Please check the Custom File Manager setting under Settings > General. Error - An error occurred while opening the folder. {0} + An error occurred while opening the folder. 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 + File or directory not found: {0} Por favor espere... diff --git a/Flow.Launcher/Languages/es.xaml b/Flow.Launcher/Languages/es.xaml index faaef8451..be00fac94 100644 --- a/Flow.Launcher/Languages/es.xaml +++ b/Flow.Launcher/Languages/es.xaml @@ -214,6 +214,8 @@ Versión Sitio web Desinstalar + Tiempo de retardo de búsqueda: predeterminado + Tiempo de retardo de búsqueda: {0}ms Fallo al eliminar la configuración del complemento Complementos: {0} - Fallo al eliminar los archivos de configuración del complemento, por favor elimínelos manualmente Fallo al eliminar la caché del complemento @@ -224,7 +226,7 @@ Fallo al desinstalar {0} No se puede encontrar plugin.json en el archivo zip extraído, o esta ruta {0} no existe Ya existe un complemento con el mismo ID y versión, o la versión es superior a la de este complemento descargado - Error creating setting panel for plugin {0}:{1}{2} + Error al crear el panel de configuración para el complemento {0}:{1}{2} Tienda complementos @@ -493,7 +495,7 @@ Argumentos del archivo El administrador de archivos '{0}' no pudo ser localizado en '{1}'. ¿Desea continuar? Error de ruta del administrador de archivos - File Explorer + Explorador de archivos Navegador web predeterminado @@ -504,8 +506,8 @@ Nueva ventana Nueva pestaña Modo privado - Default - New Profile + Predeterminado + Nuevo perfil Cambiar la prioridad @@ -595,8 +597,9 @@ Si añade un prefijo "@" al introducir un acceso directo, éste coinci No se ha encontrado el administrador de archivos especificado. Compruebe la configuración del Administrador de archivos personalizado en Configuración > General. Error - Se ha producido un error al abrir la carpeta. {0} + Se ha producido un error al abrir la carpeta. Se ha producido un error al abrir la URL en el navegador. Por favor, compruebe la configuración de su navegador web predeterminado en la sección General de la ventana de configuración + No se encuentra el archivo o directorio: {0} Por favor espere... diff --git a/Flow.Launcher/Languages/fr.xaml b/Flow.Launcher/Languages/fr.xaml index 8aa1b5cd5..b9ac0de4b 100644 --- a/Flow.Launcher/Languages/fr.xaml +++ b/Flow.Launcher/Languages/fr.xaml @@ -214,6 +214,8 @@ Version Site Web Désinstaller + Délai de recherche : par défaut + Délai de recherche : {0}ms Échec de la suppression des paramètres du plugin Plugins : {0} - Échec de la suppression des fichiers de configuration des plugins, veuillez les supprimer manuellement Échec de la suppression du cache du plugin @@ -594,8 +596,9 @@ Si vous ajoutez un préfixe "@" lors de la saisie d'un raccourci, celu Le gestionnaire de fichiers spécifié n'a pas été trouvé. Veuillez vérifier le paramètre Gestionnaire de fichiers personnalisé dans Paramètres > Général. Erreur - Une erreur s'est produite lors de l'ouverture du dossier. {0} + Une erreur s'est produite lors de l'ouverture du dossier. Une erreur s'est produite lors de l'ouverture de l'URL dans le navigateur. Veuillez vérifier la configuration de votre navigateur Web par défaut dans la section "Général" de la fenêtre des paramètres + Fichier ou répertoire introuvable : {0} Veuillez patienter... diff --git a/Flow.Launcher/Languages/he.xaml b/Flow.Launcher/Languages/he.xaml index f9f0ba2e3..ca69ddb50 100644 --- a/Flow.Launcher/Languages/he.xaml +++ b/Flow.Launcher/Languages/he.xaml @@ -213,6 +213,8 @@ גרסה אתר הסר התקנה + Search delay time: default + Search delay time: {0}ms נכשל בהסרת הגדרות התוסף תוספים: {0} - נכשל בהסרת קבצי הגדרות התוסף, יש להסירם ידנית נכשל בהסרת מטמון התוסף @@ -594,8 +596,9 @@ לא ניתן היה למצוא את מנהל הקבצים שצוין. אנא בדוק את ההגדרה של מנהל קבצים מותאם אישית תחת הגדרות > כללי. שגיאה - אירעה שגיאה בעת פתיחת התיקייה. {0} + An error occurred while opening the folder. אירעה שגיאה בעת פתיחת כתובת ה-URL בדפדפן. אנא בדוק את תצורת דפדפן האינטרנט המוגדר כברירת מחדל שלך במקטע הכללי של חלון ההגדרות + File or directory not found: {0} אנא המתן... diff --git a/Flow.Launcher/Languages/it.xaml b/Flow.Launcher/Languages/it.xaml index 60584807c..01062bed0 100644 --- a/Flow.Launcher/Languages/it.xaml +++ b/Flow.Launcher/Languages/it.xaml @@ -214,6 +214,8 @@ Versione Sito Web Disinstalla + Search delay time: default + Search delay time: {0}ms Fail to remove plugin settings Plugins: {0} - Fail to remove plugin settings files, please remove them manually Fail to remove plugin cache @@ -595,8 +597,9 @@ Se si aggiunge un prefisso '@' mentre si inserisce una scorciatoia, corrisponde The specified file manager could not be found. Please check the Custom File Manager setting under Settings > General. Error - An error occurred while opening the folder. {0} + An error occurred while opening the folder. 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 + File or directory not found: {0} Attendere prego... diff --git a/Flow.Launcher/Languages/ja.xaml b/Flow.Launcher/Languages/ja.xaml index de142733f..206791821 100644 --- a/Flow.Launcher/Languages/ja.xaml +++ b/Flow.Launcher/Languages/ja.xaml @@ -214,6 +214,8 @@ バージョン ウェブサイト アンインストール + 検索の遅延時間: デフォルト + 検索の遅延時間: {0}ms プラグイン設定の削除に失敗 プラグイン: {0} - プラグイン設定ファイルの削除に失敗しました。手動で削除してください プラグインキャッシュの削除に失敗 @@ -224,7 +226,7 @@ {0} のアンインストールに失敗 展開されたzipファイルからplugin.jsonが見つからないか、このパス {0} が存在しません 同じIDとバージョンのプラグインがすでに存在するか、またはこのダウンロードしたプラグインよりもバージョンが大きいです - Error creating setting panel for plugin {0}:{1}{2} + プラグイン {0}の設定パネル作成中にエラーが発生しました:{1}{2} プラグインストア @@ -468,7 +470,7 @@ フォルダーを開く 上級者向け機能 ログレベル - Silent + サイレント エラー 情報 デバッグ @@ -493,7 +495,7 @@ ファイル用の引数 ファイルマネージャー '{0}' は、'{1}' に見つかりませんでした。続行しますか? ファイルマネージャのパスエラー - File Explorer + ファイルエクスプローラー デフォルトのウェブブラウザー @@ -504,8 +506,8 @@ 新しいウィンドウ 新しいタブ プライベートモード - Default - New Profile + デフォルト + 新しいプロファイル 優先度の変更 @@ -595,8 +597,9 @@ 指定されたファイルマネージャーが見つかりませんでした。設定 > 一般でカスタムファイルマネージャの設定を確認してください。 エラー - フォルダを開く際にエラーが発生しました。 {0} + フォルダを開く際にエラーが発生しました。 ブラウザでURLを開く際にエラーが発生しました。設定ウィンドウの一般セクションでデフォルトのウェブブラウザ設定を確認してください + ファイルまたはフォルダーが見つかりません: {0} しばらくお待ちください… diff --git a/Flow.Launcher/Languages/ko.xaml b/Flow.Launcher/Languages/ko.xaml index 131aa50cb..674cca7a7 100644 --- a/Flow.Launcher/Languages/ko.xaml +++ b/Flow.Launcher/Languages/ko.xaml @@ -205,6 +205,8 @@ 버전 웹사이트 제거 + Search delay time: default + Search delay time: {0}ms Fail to remove plugin settings Plugins: {0} - Fail to remove plugin settings files, please remove them manually Fail to remove plugin cache @@ -586,8 +588,9 @@ If you add an '@' prefix while inputting a shortcut, it matches any position in The specified file manager could not be found. Please check the Custom File Manager setting under Settings > General. Error - An error occurred while opening the folder. {0} + An error occurred while opening the folder. 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 + File or directory not found: {0} 잠시 기다려주세요... diff --git a/Flow.Launcher/Languages/nb.xaml b/Flow.Launcher/Languages/nb.xaml index a27f66d11..68e63e37e 100644 --- a/Flow.Launcher/Languages/nb.xaml +++ b/Flow.Launcher/Languages/nb.xaml @@ -214,6 +214,8 @@ Versjon Nettsted Avinstaller + Search delay time: default + Search delay time: {0}ms Fail to remove plugin settings Plugins: {0} - Fail to remove plugin settings files, please remove them manually Fail to remove plugin cache @@ -595,8 +597,9 @@ Hvis du legger til et @-prefiks mens du legger inn en snarvei, samsvarer det med The specified file manager could not be found. Please check the Custom File Manager setting under Settings > General. Feil - An error occurred while opening the folder. {0} + An error occurred while opening the folder. 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 + File or directory not found: {0} Vennligst vent... diff --git a/Flow.Launcher/Languages/nl.xaml b/Flow.Launcher/Languages/nl.xaml index 416091858..69e2107bf 100644 --- a/Flow.Launcher/Languages/nl.xaml +++ b/Flow.Launcher/Languages/nl.xaml @@ -214,6 +214,8 @@ Versie Website Verwijderen + Search delay time: default + Search delay time: {0}ms Fail to remove plugin settings Plugins: {0} - Fail to remove plugin settings files, please remove them manually Fail to remove plugin cache @@ -595,8 +597,9 @@ Als u een '@' voorvoegsel toevoegt tijdens het invoeren van een snelkoppeling, m The specified file manager could not be found. Please check the Custom File Manager setting under Settings > General. Error - An error occurred while opening the folder. {0} + An error occurred while opening the folder. 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 + File or directory not found: {0} Please wait... diff --git a/Flow.Launcher/Languages/pl.xaml b/Flow.Launcher/Languages/pl.xaml index 1295e66c9..5786f98ab 100644 --- a/Flow.Launcher/Languages/pl.xaml +++ b/Flow.Launcher/Languages/pl.xaml @@ -8,33 +8,33 @@ Kliknij "nie", jeśli jest już zainstalowany. Zostaniesz wtedy popros Wybierz plik wykonywalny {0} - Your selected {0} executable is invalid. + Wybrany plik wykonywalny {0} jest nieprawidłowy. {2}{2} - Click yes if you would like select the {0} executable again. Click no if you would like to download {1} + Kliknij Tak, jeśli chcesz ponownie wybrać plik wykonywalny {0}. Kliknij Nie, jeśli chcesz pobrać {1} Nie można ustawić ścieżki do pliku wykonywalnego {0}. Spróbuj ponownie w ustawieniach Flow (przewiń na sam dół). Nie udało się zainicjować wtyczek Wtyczki: {0} – nie udało się ich wczytać i zostaną wyłączone. Skontaktuj się z twórcą wtyczki, aby uzyskać pomoc - Flow Launcher needs to restart to finish disabling portable mode, after the restart your portable data profile will be deleted and roaming data profile kept - Flow Launcher needs to restart to finish enabling portable mode, after the restart your roaming data profile will be deleted and portable data profile kept - Flow Launcher has detected you enabled portable mode, would you like to move it to a different location? - Flow Launcher has detected you disabled portable mode, the relevant shortcuts and uninstaller entry have been created - Flow Launcher detected your user data exists both in {0} and {1}. {2}{2}Please delete {1} in order to proceed. No changes have occurred. + Flow Launcher musi zostać ponownie uruchomiony, aby wyłączyć tryb przenośny. Spowoduje to usunięcie profilu przenośnego i zachowanie profilu mobilnego + Flow Launcher musi zostać ponownie uruchomiony, aby włączyć tryb przenośny. Spowoduje to usunięcie profilu mobilnego i zachowanie profilu przenośnego + Flow Launcher wykrył włączenie trybu przenośnego. Czy chcesz przenieść aplikację do innej lokalizacji? + Wykryto wyłączenie trybu przenośnego. Odpowiednie skróty oraz deinstalator zostały utworzone + Flow Launcher wykrył zduplikowane dane użytkownika w dwóch lokalizacjach: {0} oraz {1}.{2}{2}Aby kontynuować, usuń dane znajdujące się w {1}. Nie wprowadzono żadnych zmian. - The following plugin has errored and cannot be loaded: - The following plugins have errored and cannot be loaded: - Please refer to the logs for more information + Nie można załadować następującej wtyczki z powodu błędu: + Nie można załadować następujących wtyczek z powodu błędu: + Aby uzyskać więcej informacji, zapoznaj się z logami - Please try again - Unable to parse Http Proxy + Proszę spróbować ponownie + Nie można przetworzyć adresu serwera proxy HTTP - Failed to install TypeScript environment. Please try again later - Failed to install Python environment. Please try again later. + Instalacja środowiska TypeScript nie powiodła się. Spróbuj ponownie później. + Instalacja środowiska Python nie powiodła się. Spróbuj ponownie później. Nie udało się zarejestrować skrótu klawiszowego „{0}”. Skrót może być używany przez inny program. Zmień skrót na inny lub zamknij program, który go używa. @@ -111,7 +111,7 @@ Kliknij "nie", jeśli jest już zainstalowany. Zostaniesz wtedy popros Zawsze rozpoczynaj wpisywanie w trybie angielskim Tymczasowo zmień metodę wprowadzania na tryb angielski podczas aktywacji Flow. Automatyczne aktualizacje - Automatically check and update the app when available + Automatycznie sprawdzaj i instaluj aktualizacje, gdy będą dostępne Wybierz Uruchamiaj Flow Launcher zminimalizowany Okno wyszukiwania Flow Launcher jest ukryte w zasobniku systemowym po uruchomieniu. @@ -123,7 +123,7 @@ Kliknij "nie", jeśli jest już zainstalowany. Zostaniesz wtedy popros Niska Standardowa Szukaj z Pinyin - Pinyin is the standard system of romanized spelling for translating Chinese. Please note, enabling this can significantly increase memory usage during search. + Pinyin to standardowy system zapisu języka chińskiego za pomocą alfabetu łacińskiego. Należy pamiętać, że włączenie tej opcji może znacznie zwiększyć zużycie pamięci podczas wyszukiwania. Use Double Pinyin Use Double Pinyin instead of Full Pinyin to search. Double Pinyin Schema @@ -213,6 +213,8 @@ Kliknij "nie", jeśli jest już zainstalowany. Zostaniesz wtedy popros Wersja Strona Odinstalowywanie + Search delay time: default + Search delay time: {0}ms Nie udało się usunąć ustawień wtyczki Wtyczki: {0} – nie udało się usunąć plików ustawień wtyczek, usuń je ręcznie Nie udało się usunąć cache wtyczki @@ -594,8 +596,9 @@ Jeśli dodasz prefiks '@' podczas wprowadzania skrótu, będzie on pasował do d Nie można znaleźć określonego menedżera plików. Sprawdź ustawienie Niestandardowy menedżer plików w Ustawienia > Ogólne. Błąd - Wystąpił błąd podczas otwierania folderu. {0} + An error occurred while opening the folder. Wystąpił błąd podczas otwierania adresu URL w przeglądarce. Sprawdź konfigurację domyślnej przeglądarki internetowej w sekcji Ogólne okna ustawień + File or directory not found: {0} Proszę czekać... diff --git a/Flow.Launcher/Languages/pt-br.xaml b/Flow.Launcher/Languages/pt-br.xaml index 91193bd0a..6127e839b 100644 --- a/Flow.Launcher/Languages/pt-br.xaml +++ b/Flow.Launcher/Languages/pt-br.xaml @@ -214,6 +214,8 @@ Versão Site Desinstalar + Search delay time: default + Search delay time: {0}ms Fail to remove plugin settings Plugins: {0} - Fail to remove plugin settings files, please remove them manually Fail to remove plugin cache @@ -595,8 +597,9 @@ If you add an '@' prefix while inputting a shortcut, it matches any position in The specified file manager could not be found. Please check the Custom File Manager setting under Settings > General. Error - An error occurred while opening the folder. {0} + An error occurred while opening the folder. 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 + File or directory not found: {0} Por favor, aguarde... diff --git a/Flow.Launcher/Languages/pt-pt.xaml b/Flow.Launcher/Languages/pt-pt.xaml index 080573821..2be609c99 100644 --- a/Flow.Launcher/Languages/pt-pt.xaml +++ b/Flow.Launcher/Languages/pt-pt.xaml @@ -213,6 +213,8 @@ Versão Site Desinstalar + Tempo de atraso para pesquisa: padrão + Tempo de atraso para pesquisa: {0} ms Falha ao remover as definições do plugin Plugin: {0} - Falha ao remover o ficheiro de definições do plugin. Experimente remover manualmente. Falha ao limpar a cache do plugin @@ -593,8 +595,9 @@ Se adicionar o prefixo '@' durante a introdução do atalho, será utilizada qua Não foi possível encontrar o gestor de ficheiros. Verifique a definição 'Gestor de ficheiros personalizado' em Definições -> Geral. Erro - Ocorreu um erro ao abrir a pasta: {0} + Ocorreu um erro ao abrir a pasta. Ocorreu um erro ao abrir o URL no navegador. Verifique a configuração Navegador web padrão na secção Geral das definições. + Ficheiro ou diretório não encontrado: {0} Por favor aguarde... diff --git a/Flow.Launcher/Languages/ru.xaml b/Flow.Launcher/Languages/ru.xaml index c506d0765..df7c9d994 100644 --- a/Flow.Launcher/Languages/ru.xaml +++ b/Flow.Launcher/Languages/ru.xaml @@ -214,6 +214,8 @@ Версия Веб-сайт Удалить + Search delay time: default + Search delay time: {0}ms Fail to remove plugin settings Plugins: {0} - Fail to remove plugin settings files, please remove them manually Fail to remove plugin cache @@ -595,8 +597,9 @@ The specified file manager could not be found. Please check the Custom File Manager setting under Settings > General. Ошибка - An error occurred while opening the folder. {0} + An error occurred while opening the folder. 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 + File or directory not found: {0} Пожалуйста, подождите... diff --git a/Flow.Launcher/Languages/sk.xaml b/Flow.Launcher/Languages/sk.xaml index e909a24b1..a07613b13 100644 --- a/Flow.Launcher/Languages/sk.xaml +++ b/Flow.Launcher/Languages/sk.xaml @@ -215,6 +215,8 @@ Nevykonali sa žiadne zmeny. Verzia Webstránka Odinštalovať + Oneskorenie vyhľadávania: predvolené + Oneskorenie vyhľadávania: {0} ms Nepodarilo sa odstrániť nastavenia pluginu Pluginy: {0} – Nepodarilo sa odstrániť súbory s nastaveniami pluginu, odstráňte ich manuálne Nepodarilo sa odstrániť vyrovnávaciu pamäť pluginu @@ -596,8 +598,9 @@ Ak pri zadávaní skratky pred ňu pridáte "@", bude sa zhodovať s Zadaný správca súborov sa nenašiel. Skontrolujte nastavenie vlastného správcu súborov v Nastavenia > Všeobecné. Chyba - Počas otvárania priečinka sa vyskytla chyba. {0} + Pri otváraní priečinka došlo k chybe. Pri otváraní adresy URL v prehliadači došlo k chybe. Skontrolujte konfiguráciu predvoleného webového prehliadača v nastaveniach Všeobecné + Súbor alebo priečinok sa nenašiel: {0} Čakajte, prosím... diff --git a/Flow.Launcher/Languages/sr-Cyrl-RS.xaml b/Flow.Launcher/Languages/sr-Cyrl-RS.xaml index 189e882ec..c9cd61886 100644 --- a/Flow.Launcher/Languages/sr-Cyrl-RS.xaml +++ b/Flow.Launcher/Languages/sr-Cyrl-RS.xaml @@ -214,6 +214,8 @@ Version Website Uninstall + Search delay time: default + Search delay time: {0}ms Fail to remove plugin settings Plugins: {0} - Fail to remove plugin settings files, please remove them manually Fail to remove plugin cache @@ -595,8 +597,9 @@ If you add an '@' prefix while inputting a shortcut, it matches any position in The specified file manager could not be found. Please check the Custom File Manager setting under Settings > General. Error - An error occurred while opening the folder. {0} + An error occurred while opening the folder. 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 + File or directory not found: {0} Please wait... diff --git a/Flow.Launcher/Languages/sr.xaml b/Flow.Launcher/Languages/sr.xaml index 636942ac4..bfc41e5b8 100644 --- a/Flow.Launcher/Languages/sr.xaml +++ b/Flow.Launcher/Languages/sr.xaml @@ -214,6 +214,8 @@ Verzija Website Uninstall + Search delay time: default + Search delay time: {0}ms Fail to remove plugin settings Plugins: {0} - Fail to remove plugin settings files, please remove them manually Fail to remove plugin cache @@ -595,8 +597,9 @@ If you add an '@' prefix while inputting a shortcut, it matches any position in The specified file manager could not be found. Please check the Custom File Manager setting under Settings > General. Error - An error occurred while opening the folder. {0} + An error occurred while opening the folder. 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 + File or directory not found: {0} Please wait... diff --git a/Flow.Launcher/Languages/tr.xaml b/Flow.Launcher/Languages/tr.xaml index e91ba5b3f..2133bbb5a 100644 --- a/Flow.Launcher/Languages/tr.xaml +++ b/Flow.Launcher/Languages/tr.xaml @@ -214,6 +214,8 @@ Sürüm İnternet Sitesi Kaldır + Arama gecikme süresi: varsayılan + Arama gecikme süresi: {0}ms Eklenti ayarları kaldırılamıyor Eklentiler: {0} - Ayar dosyaları kaldırılamadı, lütfen elle silin Eklenti ön belleği kaldırılamıyor @@ -224,7 +226,7 @@ {0} kaldırılamıyor plugin.json dosyası çıkarılan zip dosyasında bulunamadı veya {0} yolu mevcut değil Bu eklentiyle aynı ID ve sürüme sahip bir eklenti zaten var, ya da mevcut sürüm daha yüksek - Error creating setting panel for plugin {0}:{1}{2} + Eklenti {0} için ayar paneli oluşturulurken hata oluştu: {1}{2} Eklenti Mağazası @@ -333,7 +335,7 @@ Yer tutucu metnini değiştirin. Boş bırakılırsa şu kullanılacak: {0} Sabit Pencere Boyutu Pencere boyutu sürüklenerek ayarlanamaz. - Since Always Preview is on, maximum results shown may not take effect because preview panel requires a certain minimum height + Always Preview (Her Zaman Önizleme) açık olduğundan, önizleme paneli belirli bir minimum yükseklik gerektirdiğinden, gösterilen maksimum sonuçlar etkili olmayabilir Kısayol Tuşu @@ -493,7 +495,7 @@ Dosya Açarken '{0}' dosya yöneticisi '{1}' konumunda bulunamadı. Devam etmek ister misiniz? Dosya Yöneticisi Yol Hatası - File Explorer + Dosya Gezgini İnternet Tarayıcı Seçenekleri @@ -504,8 +506,8 @@ Yeni Pencere Yeni Sekme Gizli Mod için Bağımsız Değişken - Default - New Profile + Varsayılan + Yeni Profil Önceliği Ayarla @@ -593,8 +595,9 @@ Belirtilen dosya yöneticisi bulunamadı. Lütfen Ayarlar > Genel bölümündeki Özel Dosya Yöneticisi ayarını kontrol edin. Hata - Klasör açılırken bir hata oluştu. {0} + Klasör açılırken bir hata oluştu. URL tarayıcıda açılırken bir hata oluştu. Lütfen ayarlar penceresindeki Genel bölümden Varsayılan Web Tarayıcısı ayarını kontrol edin + Dosya veya dizin bulunamadı: {0} Lütfen bekleyin... diff --git a/Flow.Launcher/Languages/uk-UA.xaml b/Flow.Launcher/Languages/uk-UA.xaml index 42541d046..53dcb8933 100644 --- a/Flow.Launcher/Languages/uk-UA.xaml +++ b/Flow.Launcher/Languages/uk-UA.xaml @@ -214,6 +214,8 @@ Версія Сайт Видалити + Search delay time: default + Search delay time: {0}ms Не вдалося видалити налаштування плагіну Плагіни: {0} — Не вдалося видалити файли налаштувань плагінів, видаліть їх вручну. Не вдалося видалити кеш плагіну @@ -595,8 +597,9 @@ Вказаний файловий менеджер не знайдено. Перевірте налаштування вашого файлового менеджера в розділі Налаштування > Загальні. Помилка - Під час відкриття теки сталася помилка. {0} + An error occurred while opening the folder. Під час відкриття URL-адреси в браузері сталася помилка. Перевірте налаштування типового веббраузера у розділі «Загальні» вікна налаштувань. + File or directory not found: {0} Будь ласка, зачекайте... diff --git a/Flow.Launcher/Languages/vi.xaml b/Flow.Launcher/Languages/vi.xaml index f56703b7a..0618dc9a5 100644 --- a/Flow.Launcher/Languages/vi.xaml +++ b/Flow.Launcher/Languages/vi.xaml @@ -214,6 +214,8 @@ Phiên bản Trang web Gỡ cài đặt + Search delay time: default + Search delay time: {0}ms Fail to remove plugin settings Plugins: {0} - Fail to remove plugin settings files, please remove them manually Fail to remove plugin cache @@ -599,8 +601,9 @@ The specified file manager could not be found. Please check the Custom File Manager setting under Settings > General. Lỗi - An error occurred while opening the folder. {0} + An error occurred while opening the folder. 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 + File or directory not found: {0} Cảnh báo nhỏ... diff --git a/Flow.Launcher/Languages/zh-cn.xaml b/Flow.Launcher/Languages/zh-cn.xaml index 3b368f170..a5a412439 100644 --- a/Flow.Launcher/Languages/zh-cn.xaml +++ b/Flow.Launcher/Languages/zh-cn.xaml @@ -214,6 +214,8 @@ 版本 官方网站 卸载 + 搜索延迟时间:默认 + 搜索延迟时间:{0}毫秒 移除插件设置失败 插件:{0} - 移除插件设置文件失败,请手动删除 移除插件缓存失败 @@ -224,7 +226,7 @@ 卸载 {0} 失败 无法从提取的zip文件中找到plugin.json,或者此路径 {0} 不存在 已存在相同ID和版本的插件,或者存在版本大于此下载的插件 - Error creating setting panel for plugin {0}:{1}{2} + 为插件 {0} 创建设置面板时出错:{1}{2} 插件商店 @@ -595,8 +597,9 @@ 找不到指定的文件管理器。请在“设置 > 通用”下检查自定义文件管理器设置。 错误 - 打开文件夹时发生错误。{0} + 打开文件夹时发生错误。 打开浏览器中的 URL 时发生错误。请在设置窗口的常规部分检查您的默认网页浏览器配置 + 找不到文件或目录:{0} 请稍等... diff --git a/Flow.Launcher/Languages/zh-tw.xaml b/Flow.Launcher/Languages/zh-tw.xaml index c80e8b092..7c0fef077 100644 --- a/Flow.Launcher/Languages/zh-tw.xaml +++ b/Flow.Launcher/Languages/zh-tw.xaml @@ -214,6 +214,8 @@ 版本 官方網站 解除安裝 + Search delay time: default + Search delay time: {0}ms Fail to remove plugin settings Plugins: {0} - Fail to remove plugin settings files, please remove them manually Fail to remove plugin cache @@ -595,8 +597,9 @@ If you add an '@' prefix while inputting a shortcut, it matches any position in The specified file manager could not be found. Please check the Custom File Manager setting under Settings > General. Error - An error occurred while opening the folder. {0} + An error occurred while opening the folder. 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 + File or directory not found: {0} 請稍後... diff --git a/Flow.Launcher/MainWindow.xaml.cs b/Flow.Launcher/MainWindow.xaml.cs index 7b6a0d79b..7f31de22d 100644 --- a/Flow.Launcher/MainWindow.xaml.cs +++ b/Flow.Launcher/MainWindow.xaml.cs @@ -2,6 +2,7 @@ using System; using System.ComponentModel; using System.Linq; using System.Media; +using System.Threading; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; @@ -61,8 +62,9 @@ namespace Flow.Launcher private bool _isArrowKeyPressed = false; // Window Sound Effects - private MediaPlayer animationSoundWMP; - private SoundPlayer animationSoundWPF; + private MediaPlayer _animationSoundWMP; + private SoundPlayer _animationSoundWPF; + private readonly Lock _soundLock = new(); // Window WndProc private HwndSource _hwndSource; @@ -93,6 +95,7 @@ namespace Flow.Launcher UpdatePosition(); InitSoundEffects(); + RegisterSoundEffectsEvent(); DataObject.AddPastingHandler(QueryTextBox, QueryTextBox_OnPaste); _viewModel.ActualApplicationThemeChanged += ViewModel_ActualApplicationThemeChanged; } @@ -666,16 +669,6 @@ namespace Flow.Launcher handled = true; } break; - case Win32Helper.WM_POWERBROADCAST: // Handle power broadcast messages - // https://learn.microsoft.com/en-us/windows/win32/power/wm-powerbroadcast - if (wParam.ToInt32() == Win32Helper.PBT_APMRESUMEAUTOMATIC) - { - // Fix for sound not playing after sleep / hibernate - // https://stackoverflow.com/questions/64805186/mediaplayer-doesnt-play-after-computer-sleeps - InitSoundEffects(); - } - handled = true; - break; } return IntPtr.Zero; @@ -687,31 +680,78 @@ namespace Flow.Launcher private void InitSoundEffects() { - if (_settings.WMPInstalled) + lock (_soundLock) { - animationSoundWMP?.Close(); - animationSoundWMP = new MediaPlayer(); - animationSoundWMP.Open(new Uri(AppContext.BaseDirectory + "Resources\\open.wav")); - } - else - { - animationSoundWPF?.Dispose(); - animationSoundWPF = new SoundPlayer(AppContext.BaseDirectory + "Resources\\open.wav"); - animationSoundWPF.Load(); + if (_settings.WMPInstalled) + { + _animationSoundWMP?.Close(); + _animationSoundWMP = new MediaPlayer(); + _animationSoundWMP.Open(new Uri(AppContext.BaseDirectory + "Resources\\open.wav")); + } + else + { + _animationSoundWPF?.Dispose(); + _animationSoundWPF = new SoundPlayer(AppContext.BaseDirectory + "Resources\\open.wav"); + _animationSoundWPF.Load(); + } } } private void SoundPlay() { - if (_settings.WMPInstalled) + lock (_soundLock) { - animationSoundWMP.Position = TimeSpan.Zero; - animationSoundWMP.Volume = _settings.SoundVolume / 100.0; - animationSoundWMP.Play(); + if (_settings.WMPInstalled) + { + _animationSoundWMP.Position = TimeSpan.Zero; + _animationSoundWMP.Volume = _settings.SoundVolume / 100.0; + _animationSoundWMP.Play(); + } + else + { + _animationSoundWPF.Play(); + } } - else + } + + private void RegisterSoundEffectsEvent() + { + // Fix for sound not playing after sleep / hibernate for both modern standby and legacy standby + // https://stackoverflow.com/questions/64805186/mediaplayer-doesnt-play-after-computer-sleeps + try { - animationSoundWPF.Play(); + Win32Helper.RegisterSleepModeListener(() => + { + if (Application.Current == null) + { + return; + } + + // We must run InitSoundEffects on UI thread because MediaPlayer is a DispatcherObject + if (!Application.Current.Dispatcher.CheckAccess()) + { + Application.Current.Dispatcher.Invoke(InitSoundEffects); + return; + } + + InitSoundEffects(); + }); + } + catch (Exception e) + { + App.API.LogException(ClassName, "Failed to register sound effect event", e); + } + } + + private static void UnregisterSoundEffectsEvent() + { + try + { + Win32Helper.UnregisterSleepModeListener(); + } + catch (Exception e) + { + App.API.LogException(ClassName, "Failed to unregister sound effect event", e); } } @@ -1436,9 +1476,10 @@ namespace Flow.Launcher { _hwndSource?.Dispose(); _notifyIcon?.Dispose(); - animationSoundWMP?.Close(); - animationSoundWPF?.Dispose(); + _animationSoundWMP?.Close(); + _animationSoundWPF?.Dispose(); _viewModel.ActualApplicationThemeChanged -= ViewModel_ActualApplicationThemeChanged; + UnregisterSoundEffectsEvent(); } _disposed = true; diff --git a/Flow.Launcher/PublicAPIInstance.cs b/Flow.Launcher/PublicAPIInstance.cs index 6a8ee40f9..b4c3aa92b 100644 --- a/Flow.Launcher/PublicAPIInstance.cs +++ b/Flow.Launcher/PublicAPIInstance.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Collections.Specialized; @@ -74,7 +74,6 @@ namespace Flow.Launcher _mainVM.ChangeQueryText(query, requery); } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "VSTHRD100:Avoid async void methods", Justification = "")] public void RestartApp() { _mainVM.Hide(); @@ -179,7 +178,7 @@ namespace Flow.Launcher Clipboard.SetFileDropList(paths); }); - + if (exception == null) { if (showDefaultNotification) @@ -218,7 +217,7 @@ namespace Flow.Launcher { LogException(nameof(PublicAPIInstance), "Failed to copy text to clipboard", exception); ShowMsgError(GetTranslation("failedToCopy")); - } + } } } @@ -327,7 +326,7 @@ namespace Flow.Launcher ((PluginJsonStorage)_pluginJsonStorages[type]).Save(); } - + public void OpenDirectory(string directoryPath, string fileNameOrFilePath = null) { try @@ -412,6 +411,12 @@ namespace Flow.Launcher private void OpenUri(Uri uri, bool? inPrivate = null, bool forceBrowser = false) { + if (uri.IsFile && !FilesFolders.FileOrLocationExists(uri.LocalPath)) + { + ShowMsgError(GetTranslation("errorTitle"), string.Format(GetTranslation("fileNotFoundError"), uri.LocalPath)); + return; + } + if (forceBrowser || uri.Scheme == Uri.UriSchemeHttp || uri.Scheme == Uri.UriSchemeHttps) { var browserInfo = _settings.CustomBrowser; @@ -441,13 +446,19 @@ namespace Flow.Launcher } else { - Process.Start(new ProcessStartInfo() + try { - FileName = uri.AbsoluteUri, - UseShellExecute = true - })?.Dispose(); - - return; + Process.Start(new ProcessStartInfo() + { + FileName = uri.AbsoluteUri, + UseShellExecute = true + })?.Dispose(); + } + catch (Exception e) + { + LogException(ClassName, $"Failed to open: {uri.AbsoluteUri}", e); + ShowMsgError(GetTranslation("errorTitle"), e.Message); + } } } @@ -481,7 +492,7 @@ namespace Flow.Launcher OpenUri(appUri); } - public void ToggleGameMode() + public void ToggleGameMode() { _mainVM.ToggleGameMode(); } diff --git a/Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs b/Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs index b47b53654..885330b8c 100644 --- a/Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs +++ b/Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs @@ -123,7 +123,7 @@ public partial class SettingsPaneGeneralViewModel : BaseModel } // This is only required to set at startup. When portable mode enabled/disabled a restart is always required - private static bool _portableMode = DataLocation.PortableDataLocationInUse(); + private static readonly bool _portableMode = DataLocation.PortableDataLocationInUse(); public bool PortableMode { diff --git a/Flow.Launcher/SettingPages/ViewModels/SettingsPaneHotkeyViewModel.cs b/Flow.Launcher/SettingPages/ViewModels/SettingsPaneHotkeyViewModel.cs index 9e6a31dc7..8b0718ed4 100644 --- a/Flow.Launcher/SettingPages/ViewModels/SettingsPaneHotkeyViewModel.cs +++ b/Flow.Launcher/SettingPages/ViewModels/SettingsPaneHotkeyViewModel.cs @@ -91,9 +91,12 @@ public partial class SettingsPaneHotkeyViewModel : BaseModel if (window.ShowDialog() is not true) return; var index = Settings.CustomPluginHotkeys.IndexOf(settingItem); - Settings.CustomPluginHotkeys[index] = new CustomPluginHotkey(window.Hotkey, window.ActionKeyword); - HotKeyMapper.RemoveHotkey(settingItem.Hotkey); // remove origin hotkey - HotKeyMapper.SetCustomQueryHotkey(Settings.CustomPluginHotkeys[index]); // set new hotkey + if (index >= 0 && index < Settings.CustomPluginHotkeys.Count) + { + Settings.CustomPluginHotkeys[index] = new CustomPluginHotkey(window.Hotkey, window.ActionKeyword); + HotKeyMapper.RemoveHotkey(settingItem.Hotkey); // remove origin hotkey + HotKeyMapper.SetCustomQueryHotkey(Settings.CustomPluginHotkeys[index]); // set new hotkey + } } [RelayCommand] @@ -154,7 +157,10 @@ public partial class SettingsPaneHotkeyViewModel : BaseModel if (window.ShowDialog() is not true) return; var index = Settings.CustomShortcuts.IndexOf(settingItem); - Settings.CustomShortcuts[index] = new CustomShortcutModel(window.Key, window.Value); + if (index >= 0 && index < Settings.CustomShortcuts.Count) + { + Settings.CustomShortcuts[index] = new CustomShortcutModel(window.Key, window.Value); + } } [RelayCommand] diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj index 9cb2469d9..875ffd7cf 100644 --- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj +++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj @@ -104,10 +104,10 @@ - + - - + + diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/DecimalSeparator.cs b/Plugins/Flow.Launcher.Plugin.Calculator/DecimalSeparator.cs index b3f5a8b4b..895515caa 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/DecimalSeparator.cs +++ b/Plugins/Flow.Launcher.Plugin.Calculator/DecimalSeparator.cs @@ -7,10 +7,10 @@ namespace Flow.Launcher.Plugin.Calculator { [EnumLocalizeKey(nameof(Localize.flowlauncher_plugin_calculator_decimal_separator_use_system_locale))] UseSystemLocale, - + [EnumLocalizeKey(nameof(Localize.flowlauncher_plugin_calculator_decimal_separator_dot))] - Dot, - + Dot, + [EnumLocalizeKey(nameof(Localize.flowlauncher_plugin_calculator_decimal_separator_comma))] Comma } 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 b3cee425d..20a0ec4f0 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Flow.Launcher.Plugin.Calculator.csproj +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Flow.Launcher.Plugin.Calculator.csproj @@ -63,7 +63,7 @@ - + diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Languages/es.xaml b/Plugins/Flow.Launcher.Plugin.Calculator/Languages/es.xaml index 05a862d78..eeb8923ba 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Languages/es.xaml +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Languages/es.xaml @@ -2,7 +2,7 @@ Calculadora - Perform mathematical calculations, including hex values and advanced functions such as 'min(1,2,3)', 'sqrt(123)' and 'cos(123)'. + Realiza cálculos matemáticos, incluyendo valores hexadecimales y funciones avanzadas como 'min(1,2,3)', 'sqrt(123)' y 'cos(123)'. No es un número (NaN) Expresión incorrecta o incompleta (¿Ha olvidado algunos paréntesis?) Copiar este número al portapapeles @@ -13,5 +13,5 @@ Punto (.) Número máximo de decimales Ha fallado la copia, inténtelo más tarde - Show error message when calculation fails + Mostrar mensaje de error cuando falle el cálculo diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Languages/ja.xaml b/Plugins/Flow.Launcher.Plugin.Calculator/Languages/ja.xaml index da0b64bdb..5c251d241 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Languages/ja.xaml +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Languages/ja.xaml @@ -2,7 +2,7 @@ 電卓 - Perform mathematical calculations, including hex values and advanced functions such as 'min(1,2,3)', 'sqrt(123)' and 'cos(123)'. + 16進数の値や「min(1,2,3)」、「sqrt(123)」、「cos(123)」などの高度な関数を含む数学的な計算を実行します。 数値で表せません (NaN) 式が間違っているか不完全です(括弧を忘れていませんか?) この数字をクリップボードにコピーします @@ -13,5 +13,5 @@ ドット (.) 小数点以下の最大桁数 コピーに失敗しました。後でやり直してください - Show error message when calculation fails + 計算に失敗したときにエラーメッセージを表示 diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs b/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs index 9d5e4700f..a20a1ad5d 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs @@ -5,9 +5,9 @@ using System.Linq; using System.Runtime.InteropServices; using System.Text.RegularExpressions; using System.Windows.Controls; -using Mages.Core; -using Flow.Launcher.Plugin.Calculator.Views; using Flow.Launcher.Plugin.Calculator.ViewModels; +using Flow.Launcher.Plugin.Calculator.Views; +using Mages.Core; namespace Flow.Launcher.Plugin.Calculator { @@ -26,7 +26,7 @@ namespace Flow.Launcher.Plugin.Calculator private const string IcoPath = "Images/calculator.png"; private static readonly List EmptyResults = []; - internal static PluginInitContext Context { get; set; } = null!; + internal static PluginInitContext Context { get; private set; } = null!; private Settings _settings; private SettingsViewModel _viewModel; @@ -57,10 +57,10 @@ namespace Flow.Launcher.Plugin.Calculator { var search = query.Search; bool isFunctionPresent = FunctionRegex.IsMatch(search); - + // Mages is case sensitive, so we need to convert all function names to lower case. search = FunctionRegex.Replace(search, m => m.Value.ToLowerInvariant()); - + var decimalSep = GetDecimalSeparator(); var groupSep = GetGroupSeparator(decimalSep); var expression = NumberRegex.Replace(search, m => NormalizeNumber(m.Value, isFunctionPresent, decimalSep, groupSep)); @@ -292,7 +292,7 @@ namespace Flow.Launcher.Plugin.Calculator { processedStr = processedStr.Replace(decimalSep, "."); } - + return processedStr; } else @@ -310,7 +310,7 @@ namespace Flow.Launcher.Plugin.Calculator return processedStr; } } - + private static bool IsValidGrouping(string[] parts, int[] groupSizes) { if (parts.Length <= 1) return true; @@ -326,7 +326,7 @@ namespace Flow.Launcher.Plugin.Calculator var lastGroupSize = groupSizes.Last(); var canRepeatLastGroup = lastGroupSize != 0; - + int groupIndex = 0; for (int i = parts.Length - 1; i > 0; i--) { @@ -335,7 +335,7 @@ namespace Flow.Launcher.Plugin.Calculator { expectedSize = groupSizes[groupIndex]; } - else if(canRepeatLastGroup) + else if (canRepeatLastGroup) { expectedSize = lastGroupSize; } @@ -345,7 +345,7 @@ namespace Flow.Launcher.Plugin.Calculator } if (parts[i].Length != expectedSize) return false; - + groupIndex++; } diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Settings.cs b/Plugins/Flow.Launcher.Plugin.Calculator/Settings.cs index cac0f3080..1544dc41f 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Settings.cs +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Settings.cs @@ -1,5 +1,4 @@ - -namespace Flow.Launcher.Plugin.Calculator; +namespace Flow.Launcher.Plugin.Calculator; public class Settings { diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs b/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs index 3802c701b..90db87966 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs @@ -66,8 +66,8 @@ namespace Flow.Launcher.Plugin.Explorer { contextMenus.Add(new Result { - Title = Context.API.GetTranslation("plugin_explorer_add_to_quickaccess_title"), - SubTitle = Context.API.GetTranslation("plugin_explorer_add_to_quickaccess_subtitle"), + Title = Localize.plugin_explorer_add_to_quickaccess_title(), + SubTitle = Localize.plugin_explorer_add_to_quickaccess_subtitle(), Action = (context) => { Settings.QuickAccessLinks.Add(new AccessLink @@ -77,16 +77,14 @@ namespace Flow.Launcher.Plugin.Explorer Type = record.Type }); - Context.API.ShowMsg(Context.API.GetTranslation("plugin_explorer_addfilefoldersuccess"), - Context.API.GetTranslation("plugin_explorer_addfilefoldersuccess_detail"), - Constants.ExplorerIconImageFullPath); - - + Context.API.ShowMsg(Localize.plugin_explorer_addfilefoldersuccess(), + Localize.plugin_explorer_addfilefoldersuccess_detail(), + Constants.ExplorerIconImageFullPath); return true; }, - SubTitleToolTip = Context.API.GetTranslation("plugin_explorer_contextmenu_titletooltip"), - TitleToolTip = Context.API.GetTranslation("plugin_explorer_contextmenu_titletooltip"), + SubTitleToolTip = Localize.plugin_explorer_contextmenu_titletooltip(), + TitleToolTip = Localize.plugin_explorer_contextmenu_titletooltip(), IcoPath = Constants.QuickAccessImagePath, Glyph = new GlyphInfo(FontFamily: "/Resources/#Segoe Fluent Icons", Glyph: "\ue718"), }); @@ -95,22 +93,20 @@ namespace Flow.Launcher.Plugin.Explorer { contextMenus.Add(new Result { - Title = Context.API.GetTranslation("plugin_explorer_remove_from_quickaccess_title"), - SubTitle = Context.API.GetTranslation("plugin_explorer_remove_from_quickaccess_subtitle"), + Title = Localize.plugin_explorer_remove_from_quickaccess_title(), + SubTitle = Localize.plugin_explorer_remove_from_quickaccess_subtitle(), Action = (context) => { Settings.QuickAccessLinks.Remove(Settings.QuickAccessLinks.FirstOrDefault(x => string.Equals(x.Path, record.FullPath, StringComparison.OrdinalIgnoreCase))); - Context.API.ShowMsg(Context.API.GetTranslation("plugin_explorer_removefilefoldersuccess"), - Context.API.GetTranslation("plugin_explorer_removefilefoldersuccess_detail"), - Constants.ExplorerIconImageFullPath); - - + Context.API.ShowMsg(Localize.plugin_explorer_removefilefoldersuccess(), + Localize.plugin_explorer_removefilefoldersuccess_detail(), + Constants.ExplorerIconImageFullPath); return true; }, - SubTitleToolTip = Context.API.GetTranslation("plugin_explorer_contextmenu_remove_titletooltip"), - TitleToolTip = Context.API.GetTranslation("plugin_explorer_contextmenu_remove_titletooltip"), + SubTitleToolTip = Localize.plugin_explorer_contextmenu_remove_titletooltip(), + TitleToolTip = Localize.plugin_explorer_contextmenu_remove_titletooltip(), IcoPath = Constants.RemoveQuickAccessImagePath, Glyph = new GlyphInfo(FontFamily: "/Resources/#Segoe Fluent Icons", Glyph: "\uecc9") }); @@ -118,8 +114,8 @@ namespace Flow.Launcher.Plugin.Explorer contextMenus.Add(new Result { - Title = Context.API.GetTranslation("plugin_explorer_copypath"), - SubTitle = Context.API.GetTranslation("plugin_explorer_copypath_subtitle"), + Title = Localize.plugin_explorer_copypath(), + SubTitle = Localize.plugin_explorer_copypath_subtitle(), Action = _ => { try @@ -130,7 +126,7 @@ namespace Flow.Launcher.Plugin.Explorer catch (Exception e) { LogException("Fail to set text in clipboard", e); - Context.API.ShowMsgError(Context.API.GetTranslation("plugin_explorer_fail_to_set_text")); + Context.API.ShowMsgError(Localize.plugin_explorer_fail_to_set_text()); return false; } }, @@ -140,8 +136,8 @@ namespace Flow.Launcher.Plugin.Explorer contextMenus.Add(new Result { - Title = Context.API.GetTranslation("plugin_explorer_copyname"), - SubTitle = Context.API.GetTranslation("plugin_explorer_copyname_subtitle"), + Title = Localize.plugin_explorer_copyname(), + SubTitle = Localize.plugin_explorer_copyname_subtitle(), Action = _ => { try @@ -152,7 +148,7 @@ namespace Flow.Launcher.Plugin.Explorer catch (Exception e) { LogException("Fail to set text in clipboard", e); - Context.API.ShowMsgError(Context.API.GetTranslation("plugin_explorer_fail_to_set_text")); + Context.API.ShowMsgError(Localize.plugin_explorer_fail_to_set_text()); return false; } }, @@ -162,8 +158,8 @@ namespace Flow.Launcher.Plugin.Explorer contextMenus.Add(new Result { - Title = Context.API.GetTranslation("plugin_explorer_copyfilefolder"), - SubTitle = isFile ? Context.API.GetTranslation("plugin_explorer_copyfile_subtitle") : Context.API.GetTranslation("plugin_explorer_copyfolder_subtitle"), + Title = Localize.plugin_explorer_copyfilefolder(), + SubTitle = isFile ? Localize.plugin_explorer_copyfile_subtitle(): Localize.plugin_explorer_copyfolder_subtitle(), Action = _ => { try @@ -174,28 +170,26 @@ namespace Flow.Launcher.Plugin.Explorer catch (Exception e) { LogException($"Fail to set file/folder in clipboard", e); - Context.API.ShowMsgError(Context.API.GetTranslation("plugin_explorer_fail_to_set_files")); + Context.API.ShowMsgError(Localize.plugin_explorer_fail_to_set_files()); return false; } - }, IcoPath = icoPath, Glyph = new GlyphInfo(FontFamily: "/Resources/#Segoe Fluent Icons", Glyph: "\uf12b") }); - if (record.Type is ResultType.File or ResultType.Folder) contextMenus.Add(new Result { - Title = Context.API.GetTranslation("plugin_explorer_deletefilefolder"), - SubTitle = isFile ? Context.API.GetTranslation("plugin_explorer_deletefile_subtitle") : Context.API.GetTranslation("plugin_explorer_deletefolder_subtitle"), + Title = Localize.plugin_explorer_deletefilefolder(), + SubTitle = isFile ? Localize.plugin_explorer_deletefile_subtitle(): Localize.plugin_explorer_deletefolder_subtitle(), Action = (context) => { try { if (Context.API.ShowMsgBox( - string.Format(Context.API.GetTranslation("plugin_explorer_delete_folder_link"), record.FullPath), - Context.API.GetTranslation("plugin_explorer_deletefilefolder"), + Localize.plugin_explorer_delete_folder_link(record.FullPath), + Localize.plugin_explorer_deletefilefolder(), MessageBoxButton.OKCancel, MessageBoxImage.Warning) == MessageBoxResult.Cancel) @@ -208,15 +202,15 @@ namespace Flow.Launcher.Plugin.Explorer _ = Task.Run(() => { - Context.API.ShowMsg(Context.API.GetTranslation("plugin_explorer_deletefilefoldersuccess"), - string.Format(Context.API.GetTranslation("plugin_explorer_deletefilefoldersuccess_detail"), record.FullPath), + Context.API.ShowMsg(Localize.plugin_explorer_deletefilefoldersuccess(), + Localize.plugin_explorer_deletefilefoldersuccess_detail(record.FullPath), Constants.ExplorerIconImageFullPath); }); } catch (Exception e) { LogException($"Fail to delete {record.FullPath}", e); - Context.API.ShowMsgError(string.Format(Context.API.GetTranslation("plugin_explorer_fail_to_delete"), record.FullPath)); + Context.API.ShowMsgError(Localize.plugin_explorer_fail_to_delete(record.FullPath)); return false; } @@ -230,7 +224,7 @@ namespace Flow.Launcher.Plugin.Explorer { contextMenus.Add(new Result() { - Title = Context.API.GetTranslation("plugin_explorer_show_contextmenu_title"), + Title = Localize.plugin_explorer_show_contextmenu_title(), IcoPath = Constants.ShowContextMenuImagePath, Glyph = new GlyphInfo(FontFamily: "/Resources/#Segoe Fluent Icons", Glyph: "\ue700"), Action = _ => @@ -248,8 +242,8 @@ namespace Flow.Launcher.Plugin.Explorer if (record.Type == ResultType.File && CanRunAsDifferentUser(record.FullPath)) contextMenus.Add(new Result { - Title = Context.API.GetTranslation("plugin_explorer_runasdifferentuser"), - SubTitle = Context.API.GetTranslation("plugin_explorer_runasdifferentuser_subtitle"), + Title = Localize.plugin_explorer_runasdifferentuser(), + SubTitle = Localize.plugin_explorer_runasdifferentuser_subtitle(), Action = (context) => { try @@ -259,8 +253,8 @@ namespace Flow.Launcher.Plugin.Explorer catch (FileNotFoundException e) { Context.API.ShowMsgError( - Context.API.GetTranslation("plugin_explorer_plugin_name"), - string.Format(Context.API.GetTranslation("plugin_explorer_file_not_found"), e.Message)); + Localize.plugin_explorer_plugin_name(), + Localize.plugin_explorer_file_not_found(e.Message)); return false; } @@ -317,8 +311,8 @@ namespace Flow.Launcher.Plugin.Explorer { return new Result { - Title = Context.API.GetTranslation("plugin_explorer_opencontainingfolder"), - SubTitle = Context.API.GetTranslation("plugin_explorer_opencontainingfolder_subtitle"), + Title = Localize.plugin_explorer_opencontainingfolder(), + SubTitle = Localize.plugin_explorer_opencontainingfolder_subtitle(), Action = _ => { try @@ -328,7 +322,7 @@ namespace Flow.Launcher.Plugin.Explorer catch (Exception e) { LogException($"Fail to open file at {record.FullPath}", e); - Context.API.ShowMsgError(string.Format(Context.API.GetTranslation("plugin_explorer_fail_to_open"), record.FullPath)); + Context.API.ShowMsgError(Localize.plugin_explorer_fail_to_open(record.FullPath)); return false; } @@ -339,11 +333,9 @@ namespace Flow.Launcher.Plugin.Explorer }; } - - private Result CreateOpenWithEditorResult(SearchResult record, string editorPath) { - var name = $"{Context.API.GetTranslation("plugin_explorer_openwitheditor")} {Path.GetFileNameWithoutExtension(editorPath)}"; + var name = $"{Localize.plugin_explorer_openwitheditor()} {Path.GetFileNameWithoutExtension(editorPath)}"; return new Result { @@ -361,8 +353,7 @@ namespace Flow.Launcher.Plugin.Explorer } catch (Exception e) { - var raw_message = Context.API.GetTranslation("plugin_explorer_openwitheditor_error"); - var message = string.Format(raw_message, record.FullPath, Path.GetFileNameWithoutExtension(editorPath), editorPath); + var message = Localize.plugin_explorer_openwitheditor_error(record.FullPath, Path.GetFileNameWithoutExtension(editorPath), editorPath); LogException(message, e); Context.API.ShowMsgError(message); return false; @@ -377,7 +368,7 @@ namespace Flow.Launcher.Plugin.Explorer { string shellPath = Settings.ShellPath; - var name = $"{Context.API.GetTranslation("plugin_explorer_openwithshell")} {Path.GetFileNameWithoutExtension(shellPath)}"; + var name = $"{Localize.plugin_explorer_openwithshell()} {Path.GetFileNameWithoutExtension(shellPath)}"; return new Result { @@ -394,8 +385,7 @@ namespace Flow.Launcher.Plugin.Explorer } catch (Exception e) { - var raw_message = Context.API.GetTranslation("plugin_explorer_openwithshell_error"); - var message = string.Format(raw_message, record.FullPath, Path.GetFileNameWithoutExtension(shellPath), shellPath); + var message = Localize.plugin_explorer_openwithshell_error(record.FullPath, Path.GetFileNameWithoutExtension(shellPath), shellPath); LogException(message, e); Context.API.ShowMsgError(message); return false; @@ -410,8 +400,8 @@ namespace Flow.Launcher.Plugin.Explorer { return new Result { - Title = Context.API.GetTranslation("plugin_explorer_excludefromindexsearch"), - SubTitle = Context.API.GetTranslation("plugin_explorer_path") + " " + record.FullPath, + Title = Localize.plugin_explorer_excludefromindexsearch(), + SubTitle = Localize.plugin_explorer_path()+ " " + record.FullPath, Action = c_ => { if (!Settings.IndexSearchExcludedSubdirectoryPaths.Any(x => string.Equals(x.Path, record.FullPath, StringComparison.OrdinalIgnoreCase))) @@ -422,8 +412,8 @@ namespace Flow.Launcher.Plugin.Explorer _ = Task.Run(() => { - Context.API.ShowMsg(Context.API.GetTranslation("plugin_explorer_excludedfromindexsearch_msg"), - Context.API.GetTranslation("plugin_explorer_path") + + Context.API.ShowMsg(Localize.plugin_explorer_excludedfromindexsearch_msg(), + Localize.plugin_explorer_path()+ " " + record.FullPath, Constants.ExplorerIconImageFullPath); // so the new path can be persisted to storage and not wait till next ViewModel save. @@ -441,8 +431,8 @@ namespace Flow.Launcher.Plugin.Explorer { return new Result { - Title = Context.API.GetTranslation("plugin_explorer_openindexingoptions"), - SubTitle = Context.API.GetTranslation("plugin_explorer_openindexingoptions_subtitle"), + Title = Localize.plugin_explorer_openindexingoptions(), + SubTitle = Localize.plugin_explorer_openindexingoptions_subtitle(), Action = _ => { try @@ -459,7 +449,7 @@ namespace Flow.Launcher.Plugin.Explorer } catch (Exception e) { - var message = Context.API.GetTranslation("plugin_explorer_openindexingoptions_errormsg"); + var message = Localize.plugin_explorer_openindexingoptions_errormsg(); LogException(message, e); Context.API.ShowMsgError(message); return false; @@ -470,12 +460,12 @@ namespace Flow.Launcher.Plugin.Explorer }; } - private Result CreateOpenWithMenu(SearchResult record) + private static Result CreateOpenWithMenu(SearchResult record) { return new Result { - Title = Context.API.GetTranslation("plugin_explorer_openwith"), - SubTitle = Context.API.GetTranslation("plugin_explorer_openwith_subtitle"), + Title = Localize.plugin_explorer_openwith(), + SubTitle = Localize.plugin_explorer_openwith_subtitle(), Action = _ => { Process.Start("rundll32.exe", $"{Path.Combine(Environment.SystemDirectory, "shell32.dll")},OpenAs_RunDLL {record.FullPath}"); diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Flow.Launcher.Plugin.Explorer.csproj b/Plugins/Flow.Launcher.Plugin.Explorer/Flow.Launcher.Plugin.Explorer.csproj index b7c54e578..a837a49b4 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Flow.Launcher.Plugin.Explorer.csproj +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Flow.Launcher.Plugin.Explorer.csproj @@ -48,7 +48,7 @@ - + diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml index 16ef037cc..c40040df5 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml @@ -24,6 +24,7 @@ Error occurred during search: {0} Could not open folder Could not open file + This new action keyword is already assigned to another plugin, please choose a different one Delete diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/es.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/es.xaml index 0a1d73c28..b59ada7ea 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/es.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/es.xaml @@ -22,7 +22,7 @@ Se ha producido un error durante la búsqueda: {0} No se ha podido abrir la carpeta No se ha podido abrir el archivo - This new action keyword is already assigned to another plugin, please choose a different one + Esta nueva palabra clave de acción ya está asignada a otro complemento, por favor elija otra diferente Eliminar diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/fr.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/fr.xaml index d9b767b9c..b0b714154 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/fr.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/fr.xaml @@ -22,7 +22,7 @@ Une erreur s'est produite pendant la recherche : {0} Impossible d'ouvrir le dossier Impossible d'ouvrir le fichier - This new action keyword is already assigned to another plugin, please choose a different one + Ce nouveau mot-clé d'action est déjà assigné à un autre plugin, veuillez en choisir un autre Supprimer diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/tr.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/tr.xaml index 3e491ea22..92461291b 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/tr.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/tr.xaml @@ -6,7 +6,7 @@ Lütfen bir klasör yolu seçin. Lütfen farklı bir isim veya klasör yolu seçin. Bu hızlı erişim bağlantısını silmek istediğinizden emin misiniz? - Are you sure you want to delete this index search excluded path? + Bu dizin arama hariç tutulan yolu silmek istediğinizden emin misiniz? Lütfen bir klasör bağlantısı seçin {0} bağlantısını silmek istediğinize emin misiniz? Bu dosyayı kalıcı olarak silmek istediğinizden emin misiniz? @@ -22,7 +22,7 @@ Arama sırasında hata oluştu: {0} Klasör açılamadı Dosya açılamadı - This new action keyword is already assigned to another plugin, please choose a different one + Bu yeni anahtar kelime zaten başka bir eklentiye atanmıştır, lütfen farklı bir tane seçin Sil diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/zh-cn.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/zh-cn.xaml index 1cab71d8d..bcef2b668 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/zh-cn.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/zh-cn.xaml @@ -22,7 +22,7 @@ 搜索时发生错误:{0} 无法打开文件夹 无法打开文件 - This new action keyword is already assigned to another plugin, please choose a different one + 此触发关键字已经被指派给其他插件了,请换一个关键字 删除 diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Main.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Main.cs index d93c6c77b..f5b8b9325 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Main.cs @@ -90,12 +90,12 @@ namespace Flow.Launcher.Plugin.Explorer public string GetTranslatedPluginTitle() { - return Context.API.GetTranslation("plugin_explorer_plugin_name"); + return Localize.plugin_explorer_plugin_name(); } public string GetTranslatedPluginDescription() { - return Context.API.GetTranslation("plugin_explorer_plugin_description"); + return Localize.plugin_explorer_plugin_description(); } public void OnCultureInfoChanged(CultureInfo newCulture) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/EverythingDownloadHelper.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/EverythingDownloadHelper.cs index c8bd68279..13d988f1a 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/EverythingDownloadHelper.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/EverythingDownloadHelper.cs @@ -21,9 +21,9 @@ public static class EverythingDownloadHelper if (string.IsNullOrEmpty(installedLocation)) { if (api.ShowMsgBox( - string.Format(api.GetTranslation("flowlauncher_plugin_everything_installing_select"), Environment.NewLine), - api.GetTranslation("flowlauncher_plugin_everything_installing_title"), - MessageBoxButton.YesNo) == MessageBoxResult.Yes) + Localize.flowlauncher_plugin_everything_installing_select(Environment.NewLine), + Localize.flowlauncher_plugin_everything_installing_title(), + MessageBoxButton.YesNo) == MessageBoxResult.Yes) { var dlg = new System.Windows.Forms.OpenFileDialog { @@ -41,13 +41,13 @@ public static class EverythingDownloadHelper return installedLocation; } - api.ShowMsg(api.GetTranslation("flowlauncher_plugin_everything_installing_title"), - api.GetTranslation("flowlauncher_plugin_everything_installing_subtitle"), "", useMainWindowAsOwner: false); + api.ShowMsg(Localize.flowlauncher_plugin_everything_installing_title(), + Localize.flowlauncher_plugin_everything_installing_subtitle(), "", useMainWindowAsOwner: false); await DroplexPackage.Drop(App.Everything1_4_1_1009).ConfigureAwait(false); - api.ShowMsg(api.GetTranslation("flowlauncher_plugin_everything_installing_title"), - api.GetTranslation("flowlauncher_plugin_everything_installationsuccess_subtitle"), "", useMainWindowAsOwner: false); + api.ShowMsg(Localize.flowlauncher_plugin_everything_installing_title(), + Localize.flowlauncher_plugin_everything_installationsuccess_subtitle(), "", useMainWindowAsOwner: false); installedLocation = "C:\\Program Files\\Everything\\Everything.exe"; @@ -83,6 +83,5 @@ public static class EverythingDownloadHelper var scoopInstalledPath = Environment.ExpandEnvironmentVariables(@"%userprofile%\scoop\apps\everything\current\Everything.exe"); return File.Exists(scoopInstalledPath) ? scoopInstalledPath : string.Empty; - } } diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/EverythingSearchManager.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/EverythingSearchManager.cs index ce71c94ba..eb994a6f9 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/EverythingSearchManager.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/EverythingSearchManager.cs @@ -27,8 +27,8 @@ namespace Flow.Launcher.Plugin.Explorer.Search.Everything if (!await EverythingApi.IsEverythingRunningAsync(token)) throw new EngineNotAvailableException( Enum.GetName(Settings.IndexSearchEngineOption.Everything)!, - Main.Context.API.GetTranslation("flowlauncher_plugin_everything_click_to_launch_or_install"), - Main.Context.API.GetTranslation("flowlauncher_plugin_everything_is_not_running"), + Localize.flowlauncher_plugin_everything_click_to_launch_or_install(), + Localize.flowlauncher_plugin_everything_is_not_running(), Constants.EverythingErrorImagePath, ClickToInstallEverythingAsync); } @@ -38,7 +38,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search.Everything Enum.GetName(Settings.IndexSearchEngineOption.Everything)!, "Please check whether your system is x86 or x64", Constants.GeneralSearchErrorImagePath, - Main.Context.API.GetTranslation("flowlauncher_plugin_everything_sdk_issue")); + Localize.flowlauncher_plugin_everything_sdk_issue()); } } @@ -50,7 +50,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search.Everything if (installedPath == null) { - Main.Context.API.ShowMsgError(Main.Context.API.GetTranslation("flowlauncher_plugin_everything_not_found")); + Main.Context.API.ShowMsgError(Localize.flowlauncher_plugin_everything_not_found()); Main.Context.API.LogError(ClassName, "Unable to find Everything.exe"); return false; @@ -65,7 +65,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search.Everything // Just let the user know that Everything is not installed properly and ask them to install it manually catch (Exception e) { - Main.Context.API.ShowMsgError(Main.Context.API.GetTranslation("flowlauncher_plugin_everything_install_issue")); + Main.Context.API.ShowMsgError(Localize.flowlauncher_plugin_everything_install_issue()); Main.Context.API.LogException(ClassName, "Failed to install Everything", e); return false; @@ -97,8 +97,8 @@ namespace Flow.Launcher.Plugin.Explorer.Search.Everything if (!Settings.EnableEverythingContentSearch) { throw new EngineNotAvailableException(Enum.GetName(Settings.IndexSearchEngineOption.Everything)!, - Main.Context.API.GetTranslation("flowlauncher_plugin_everything_enable_content_search"), - Main.Context.API.GetTranslation("flowlauncher_plugin_everything_enable_content_search_tips"), + Localize.flowlauncher_plugin_everything_enable_content_search(), + Localize.flowlauncher_plugin_everything_enable_content_search_tips(), Constants.EverythingErrorImagePath, _ => { diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs index dfa2c8d43..18eb168b9 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.IO; using System.Linq; using System.Threading.Tasks; @@ -124,7 +124,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search } catch (Exception ex) { - Context.API.ShowMsgBox(ex.Message, Context.API.GetTranslation("plugin_explorer_opendir_error")); + Context.API.ShowMsgBox(ex.Message, Localize.plugin_explorer_opendir_error()); return false; } } @@ -138,7 +138,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search } catch (Exception ex) { - Context.API.ShowMsgBox(ex.Message, Context.API.GetTranslation("plugin_explorer_opendir_error")); + Context.API.ShowMsgBox(ex.Message, Localize.plugin_explorer_opendir_error()); return false; } } @@ -153,7 +153,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search } catch (Exception ex) { - Context.API.ShowMsgBox(ex.Message, Context.API.GetTranslation("plugin_explorer_opendir_error")); + Context.API.ShowMsgBox(ex.Message, Localize.plugin_explorer_opendir_error()); return false; } } @@ -166,7 +166,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search return false; }, Score = score, - TitleToolTip = Main.Context.API.GetTranslation("plugin_explorer_plugin_ToolTipOpenDirectory"), + TitleToolTip = Localize.plugin_explorer_plugin_ToolTipOpenDirectory(), SubTitleToolTip = Settings.DisplayMoreInformationInToolTip ? GetFolderMoreInfoTooltip(path) : path, ContextData = new SearchResult { Type = ResultType.Folder, FullPath = path, WindowsIndexed = windowsIndexed } }; @@ -190,7 +190,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search DriveInfo drv = new DriveInfo(driveLetter); var freespace = ToReadableSize(drv.AvailableFreeSpace, 2); var totalspace = ToReadableSize(drv.TotalSize, 2); - var subtitle = string.Format(Context.API.GetTranslation("plugin_explorer_diskfreespace"), freespace, totalspace); + var subtitle = Localize.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); @@ -262,8 +262,8 @@ namespace Flow.Launcher.Plugin.Explorer.Search return new Result { - Title = Context.API.GetTranslation("plugin_explorer_openresultfolder"), - SubTitle = Context.API.GetTranslation("plugin_explorer_openresultfolder_subtitle"), + Title = Localize.plugin_explorer_openresultfolder(), + SubTitle = Localize.plugin_explorer_openresultfolder_subtitle(), AutoCompleteText = GetPathWithActionKeyword(folderPath, ResultType.Folder, actionKeyword), IcoPath = folderPath, Score = 500, @@ -330,12 +330,12 @@ namespace Flow.Launcher.Plugin.Explorer.Search } catch (Exception ex) { - Context.API.ShowMsgBox(ex.Message, Context.API.GetTranslation("plugin_explorer_openfile_error")); + Context.API.ShowMsgBox(ex.Message, Localize.plugin_explorer_openfile_error()); } return true; }, - TitleToolTip = Main.Context.API.GetTranslation("plugin_explorer_plugin_ToolTipOpenContainingFolder"), + TitleToolTip = Localize.plugin_explorer_plugin_ToolTipOpenContainingFolder(), SubTitleToolTip = Settings.DisplayMoreInformationInToolTip ? GetFileMoreInfoTooltip(filePath) : filePath, ContextData = new SearchResult { Type = ResultType.File, FullPath = filePath, WindowsIndexed = windowsIndexed } }; @@ -374,8 +374,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search var fileSize = PreviewPanel.GetFileSize(filePath); var fileCreatedAt = PreviewPanel.GetFileCreatedAt(filePath, Settings.PreviewPanelDateFormat, Settings.PreviewPanelTimeFormat, Settings.ShowFileAgeInPreviewPanel); var fileModifiedAt = PreviewPanel.GetFileLastModifiedAt(filePath, Settings.PreviewPanelDateFormat, Settings.PreviewPanelTimeFormat, Settings.ShowFileAgeInPreviewPanel); - return string.Format(Context.API.GetTranslation("plugin_explorer_plugin_tooltip_more_info"), - filePath, fileSize, fileCreatedAt, fileModifiedAt, Environment.NewLine); + return Localize.plugin_explorer_plugin_tooltip_more_info(filePath, fileSize, fileCreatedAt, fileModifiedAt, Environment.NewLine); } catch (Exception e) { @@ -391,8 +390,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search var folderSize = PreviewPanel.GetFolderSize(folderPath); var folderCreatedAt = PreviewPanel.GetFolderCreatedAt(folderPath, Settings.PreviewPanelDateFormat, Settings.PreviewPanelTimeFormat, Settings.ShowFileAgeInPreviewPanel); var folderModifiedAt = PreviewPanel.GetFolderLastModifiedAt(folderPath, Settings.PreviewPanelDateFormat, Settings.PreviewPanelTimeFormat, Settings.ShowFileAgeInPreviewPanel); - return string.Format(Context.API.GetTranslation("plugin_explorer_plugin_tooltip_more_info"), - folderPath, folderSize, folderCreatedAt, folderModifiedAt, Environment.NewLine); + return Localize.plugin_explorer_plugin_tooltip_more_info(folderPath, folderSize, folderCreatedAt, folderModifiedAt, Environment.NewLine); } catch (Exception e) { @@ -403,8 +401,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search private static string GetVolumeMoreInfoTooltip(string volumePath, string freespace, string totalspace) { - return string.Format(Context.API.GetTranslation("plugin_explorer_plugin_tooltip_more_info_volume"), - volumePath, freespace, totalspace, Environment.NewLine); + return Localize.plugin_explorer_plugin_tooltip_more_info_volume(volumePath, freespace, totalspace, Environment.NewLine); } private static readonly string[] MediaExtensions = diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs index f4f87d4d4..f9d8963e6 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs @@ -161,8 +161,8 @@ namespace Flow.Launcher.Plugin.Explorer.Search { new() { - Title = Context.API.GetTranslation("flowlauncher_plugin_everything_enable_content_search"), - SubTitle = Context.API.GetTranslation("flowlauncher_plugin_everything_enable_content_search_tips"), + Title = Localize.flowlauncher_plugin_everything_enable_content_search(), + SubTitle = Localize.flowlauncher_plugin_everything_enable_content_search_tips(), IcoPath = "Images/index_error.png", Action = c => { diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/WindowsIndexSearchManager.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/WindowsIndexSearchManager.cs index 3d69a1ee6..eeb5c2c4a 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/WindowsIndexSearchManager.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/WindowsIndexSearchManager.cs @@ -105,8 +105,8 @@ namespace Flow.Launcher.Plugin.Explorer.Search.WindowsIndex throw new EngineNotAvailableException( "Windows Index", - Main.Context.API.GetTranslation("plugin_explorer_windowsSearchServiceFix"), - Main.Context.API.GetTranslation("plugin_explorer_windowsSearchServiceNotRunning"), + Localize.plugin_explorer_windowsSearchServiceFix(), + Localize.plugin_explorer_windowsSearchServiceNotRunning(), Constants.WindowsIndexErrorImagePath, c => { diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs index 672e81d03..8d62531cd 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs @@ -14,9 +14,9 @@ namespace Flow.Launcher.Plugin.Explorer { public int MaxResult { get; set; } = 100; - public ObservableCollection QuickAccessLinks { get; set; } = new(); + public ObservableCollection QuickAccessLinks { get; set; } = []; - public ObservableCollection IndexSearchExcludedSubdirectoryPaths { get; set; } = new ObservableCollection(); + public ObservableCollection IndexSearchExcludedSubdirectoryPaths { get; set; } = []; public string EditorPath { get; set; } = ""; @@ -58,7 +58,6 @@ namespace Flow.Launcher.Plugin.Explorer public bool QuickAccessKeywordEnabled { get; set; } - public bool WarnWindowsSearchServiceOff { get; set; } = true; public bool ShowFileSizeInPreviewPanel { get; set; } = true; @@ -69,7 +68,6 @@ namespace Flow.Launcher.Plugin.Explorer public bool ShowFileAgeInPreviewPanel { get; set; } = false; - public string PreviewPanelDateFormat { get; set; } = "yyyy-MM-dd"; public string PreviewPanelTimeFormat { get; set; } = "HH:mm"; @@ -82,8 +80,8 @@ namespace Flow.Launcher.Plugin.Explorer private EverythingSearchManager EverythingManagerInstance => _everythingManagerInstance ??= new EverythingSearchManager(this); private WindowsIndexSearchManager WindowsIndexSearchManager => _windowsIndexSearchManager ??= new WindowsIndexSearchManager(this); - public IndexSearchEngineOption IndexSearchEngine { get; set; } = IndexSearchEngineOption.WindowsIndex; + [JsonIgnore] public IIndexProvider IndexProvider => IndexSearchEngine switch { @@ -139,7 +137,6 @@ namespace Flow.Launcher.Plugin.Explorer #endregion - #region Everything Settings public string EverythingInstalledPath { get; set; } diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs b/Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs index ae2235c5c..2d46c6307 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs @@ -296,7 +296,7 @@ namespace Flow.Launcher.Plugin.Explorer.ViewModels return; } - var actionKeywordWindow = new ActionKeywordSetting(actionKeyword, Context.API); + var actionKeywordWindow = new ActionKeywordSetting(actionKeyword); if (!(actionKeywordWindow.ShowDialog() ?? false)) { @@ -432,8 +432,8 @@ namespace Flow.Launcher.Plugin.Explorer.ViewModels case "QuickAccessLink": if (SelectedQuickAccessLink == null) return; if (Context.API.ShowMsgBox( - Context.API.GetTranslation("plugin_explorer_delete_quick_access_link"), - Context.API.GetTranslation("plugin_explorer_delete"), + Localize.plugin_explorer_delete_quick_access_link(), + Localize.plugin_explorer_delete(), MessageBoxButton.OKCancel, MessageBoxImage.Warning) == MessageBoxResult.Cancel) @@ -443,8 +443,8 @@ namespace Flow.Launcher.Plugin.Explorer.ViewModels case "IndexSearchExcludedPaths": if (SelectedIndexSearchExcludedPath == null) return; if (Context.API.ShowMsgBox( - Context.API.GetTranslation("plugin_explorer_delete_index_search_excluded_path"), - Context.API.GetTranslation("plugin_explorer_delete"), + Localize.plugin_explorer_delete_index_search_excluded_path(), + Localize.plugin_explorer_delete(), MessageBoxButton.OKCancel, MessageBoxImage.Warning) == MessageBoxResult.Cancel) @@ -457,7 +457,7 @@ namespace Flow.Launcher.Plugin.Explorer.ViewModels private void ShowUnselectedMessage() { - var warning = Context.API.GetTranslation("plugin_explorer_make_selection_warning"); + var warning = Localize.plugin_explorer_make_selection_warning(); Context.API.ShowMsgBox(warning); } diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ActionKeywordSetting.xaml.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ActionKeywordSetting.xaml.cs index 829a2feed..562170062 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ActionKeywordSetting.xaml.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ActionKeywordSetting.xaml.cs @@ -29,13 +29,11 @@ namespace Flow.Launcher.Plugin.Explorer.Views } private string actionKeyword; - private readonly IPublicAPI _api; private bool _keywordEnabled; - public ActionKeywordSetting(ActionKeywordModel selectedActionKeyword, IPublicAPI api) + public ActionKeywordSetting(ActionKeywordModel selectedActionKeyword) { CurrentActionKeyword = selectedActionKeyword; - _api = api; ActionKeyword = selectedActionKeyword.Keyword; KeywordEnabled = selectedActionKeyword.Enabled; @@ -60,14 +58,14 @@ namespace Flow.Launcher.Plugin.Explorer.Views switch (CurrentActionKeyword.KeywordProperty, KeywordEnabled) { case (Settings.ActionKeyword.FileContentSearchActionKeyword, true): - _api.ShowMsgBox(_api.GetTranslation("plugin_explorer_globalActionKeywordInvalid")); + Main.Context.API.ShowMsgBox(Localize.plugin_explorer_globalActionKeywordInvalid()); return; case (Settings.ActionKeyword.QuickAccessActionKeyword, true): - _api.ShowMsgBox(_api.GetTranslation("plugin_explorer_quickaccess_globalActionKeywordInvalid")); + Main.Context.API.ShowMsgBox(Localize.plugin_explorer_quickaccess_globalActionKeywordInvalid()); return; } - if (!KeywordEnabled || !_api.ActionKeywordAssigned(ActionKeyword)) + if (!KeywordEnabled || !Main.Context.API.ActionKeywordAssigned(ActionKeyword)) { DialogResult = true; Close(); @@ -75,7 +73,7 @@ namespace Flow.Launcher.Plugin.Explorer.Views } // The keyword is not valid, so show message - _api.ShowMsgBox(_api.GetTranslation("newActionKeywordsHasBeenAssigned")); + Main.Context.API.ShowMsgBox(Localize.plugin_explorer_new_action_keyword_assigned()); } private void BtnCancel_OnClick(object sender, RoutedEventArgs e) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Views/PreviewPanel.xaml.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Views/PreviewPanel.xaml.cs index 4dd0588ee..3c627cc06 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Views/PreviewPanel.xaml.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Views/PreviewPanel.xaml.cs @@ -25,7 +25,7 @@ public partial class PreviewPanel : UserControl public string FileName { get; } [ObservableProperty] - private string _fileSize = Main.Context.API.GetTranslation("plugin_explorer_plugin_tooltip_more_info_unknown"); + private string _fileSize = Localize.plugin_explorer_plugin_tooltip_more_info_unknown(); [ObservableProperty] private string _createdAt = ""; @@ -111,17 +111,17 @@ public partial class PreviewPanel : UserControl catch (FileNotFoundException) { Main.Context.API.LogError(ClassName, $"File not found: {filePath}"); - return Main.Context.API.GetTranslation("plugin_explorer_plugin_tooltip_more_info_unknown"); + return Localize.plugin_explorer_plugin_tooltip_more_info_unknown(); } catch (UnauthorizedAccessException) { Main.Context.API.LogError(ClassName, $"Access denied to file: {filePath}"); - return Main.Context.API.GetTranslation("plugin_explorer_plugin_tooltip_more_info_unknown"); + return Localize.plugin_explorer_plugin_tooltip_more_info_unknown(); } catch (Exception e) { Main.Context.API.LogException(ClassName, $"Failed to get file size for {filePath}", e); - return Main.Context.API.GetTranslation("plugin_explorer_plugin_tooltip_more_info_unknown"); + return Localize.plugin_explorer_plugin_tooltip_more_info_unknown(); } } @@ -142,17 +142,17 @@ public partial class PreviewPanel : UserControl catch (FileNotFoundException) { Main.Context.API.LogError(ClassName, $"File not found: {filePath}"); - return Main.Context.API.GetTranslation("plugin_explorer_plugin_tooltip_more_info_unknown"); + return Localize.plugin_explorer_plugin_tooltip_more_info_unknown(); } catch (UnauthorizedAccessException) { Main.Context.API.LogError(ClassName, $"Access denied to file: {filePath}"); - return Main.Context.API.GetTranslation("plugin_explorer_plugin_tooltip_more_info_unknown"); + return Localize.plugin_explorer_plugin_tooltip_more_info_unknown(); } catch (Exception e) { Main.Context.API.LogException(ClassName, $"Failed to get file created date for {filePath}", e); - return Main.Context.API.GetTranslation("plugin_explorer_plugin_tooltip_more_info_unknown"); + return Localize.plugin_explorer_plugin_tooltip_more_info_unknown(); } } @@ -173,17 +173,17 @@ public partial class PreviewPanel : UserControl catch (FileNotFoundException) { Main.Context.API.LogError(ClassName, $"File not found: {filePath}"); - return Main.Context.API.GetTranslation("plugin_explorer_plugin_tooltip_more_info_unknown"); + return Localize.plugin_explorer_plugin_tooltip_more_info_unknown(); } catch (UnauthorizedAccessException) { Main.Context.API.LogError(ClassName, $"Access denied to file: {filePath}"); - return Main.Context.API.GetTranslation("plugin_explorer_plugin_tooltip_more_info_unknown"); + return Localize.plugin_explorer_plugin_tooltip_more_info_unknown(); } catch (Exception e) { Main.Context.API.LogException(ClassName, $"Failed to get file modified date for {filePath}", e); - return Main.Context.API.GetTranslation("plugin_explorer_plugin_tooltip_more_info_unknown"); + return Localize.plugin_explorer_plugin_tooltip_more_info_unknown(); } } @@ -205,17 +205,17 @@ public partial class PreviewPanel : UserControl catch (FileNotFoundException) { Main.Context.API.LogError(ClassName, $"Folder not found: {folderPath}"); - return Main.Context.API.GetTranslation("plugin_explorer_plugin_tooltip_more_info_unknown"); + return Localize.plugin_explorer_plugin_tooltip_more_info_unknown(); } catch (UnauthorizedAccessException) { Main.Context.API.LogError(ClassName, $"Access denied to folder: {folderPath}"); - return Main.Context.API.GetTranslation("plugin_explorer_plugin_tooltip_more_info_unknown"); + return Localize.plugin_explorer_plugin_tooltip_more_info_unknown(); } catch (OperationCanceledException) { Main.Context.API.LogError(ClassName, $"Operation timed out while calculating folder size for {folderPath}"); - return Main.Context.API.GetTranslation("plugin_explorer_plugin_tooltip_more_info_unknown"); + return Localize.plugin_explorer_plugin_tooltip_more_info_unknown(); } // For parallel operations, AggregateException may be thrown if any of the tasks fail catch (AggregateException ae) @@ -224,22 +224,22 @@ public partial class PreviewPanel : UserControl { case FileNotFoundException: Main.Context.API.LogError(ClassName, $"Folder not found: {folderPath}"); - return Main.Context.API.GetTranslation("plugin_explorer_plugin_tooltip_more_info_unknown"); + return Localize.plugin_explorer_plugin_tooltip_more_info_unknown(); case UnauthorizedAccessException: Main.Context.API.LogError(ClassName, $"Access denied to folder: {folderPath}"); - return Main.Context.API.GetTranslation("plugin_explorer_plugin_tooltip_more_info_unknown"); + return Localize.plugin_explorer_plugin_tooltip_more_info_unknown(); case OperationCanceledException: Main.Context.API.LogError(ClassName, $"Operation timed out while calculating folder size for {folderPath}"); - return Main.Context.API.GetTranslation("plugin_explorer_plugin_tooltip_more_info_unknown"); + return Localize.plugin_explorer_plugin_tooltip_more_info_unknown(); default: Main.Context.API.LogException(ClassName, $"Failed to get folder size for {folderPath}", ae); - return Main.Context.API.GetTranslation("plugin_explorer_plugin_tooltip_more_info_unknown"); + return Localize.plugin_explorer_plugin_tooltip_more_info_unknown(); } } catch (Exception e) { Main.Context.API.LogException(ClassName, $"Failed to get folder size for {folderPath}", e); - return Main.Context.API.GetTranslation("plugin_explorer_plugin_tooltip_more_info_unknown"); + return Localize.plugin_explorer_plugin_tooltip_more_info_unknown(); } } @@ -260,17 +260,17 @@ public partial class PreviewPanel : UserControl catch (FileNotFoundException) { Main.Context.API.LogError(ClassName, $"Folder not found: {folderPath}"); - return Main.Context.API.GetTranslation("plugin_explorer_plugin_tooltip_more_info_unknown"); + return Localize.plugin_explorer_plugin_tooltip_more_info_unknown(); } catch (UnauthorizedAccessException) { Main.Context.API.LogError(ClassName, $"Access denied to folder: {folderPath}"); - return Main.Context.API.GetTranslation("plugin_explorer_plugin_tooltip_more_info_unknown"); + return Localize.plugin_explorer_plugin_tooltip_more_info_unknown(); } catch (Exception e) { Main.Context.API.LogException(ClassName, $"Failed to get folder created date for {folderPath}", e); - return Main.Context.API.GetTranslation("plugin_explorer_plugin_tooltip_more_info_unknown"); + return Localize.plugin_explorer_plugin_tooltip_more_info_unknown(); } } @@ -291,17 +291,17 @@ public partial class PreviewPanel : UserControl catch (FileNotFoundException) { Main.Context.API.LogError(ClassName, $"Folder not found: {folderPath}"); - return Main.Context.API.GetTranslation("plugin_explorer_plugin_tooltip_more_info_unknown"); + return Localize.plugin_explorer_plugin_tooltip_more_info_unknown(); } catch (UnauthorizedAccessException) { Main.Context.API.LogError(ClassName, $"Access denied to folder: {folderPath}"); - return Main.Context.API.GetTranslation("plugin_explorer_plugin_tooltip_more_info_unknown"); + return Localize.plugin_explorer_plugin_tooltip_more_info_unknown(); } catch (Exception e) { Main.Context.API.LogException(ClassName, $"Failed to get folder modified date for {folderPath}", e); - return Main.Context.API.GetTranslation("plugin_explorer_plugin_tooltip_more_info_unknown"); + return Localize.plugin_explorer_plugin_tooltip_more_info_unknown(); } } @@ -311,21 +311,20 @@ public partial class PreviewPanel : UserControl var difference = now - fileDateTime; if (difference.TotalDays < 1) - return Main.Context.API.GetTranslation("Today"); + return Localize.Today(); if (difference.TotalDays < 30) - return string.Format(Main.Context.API.GetTranslation("DaysAgo"), (int)difference.TotalDays); + return Localize.DaysAgo((int)difference.TotalDays); var monthsDiff = (now.Year - fileDateTime.Year) * 12 + now.Month - fileDateTime.Month; if (monthsDiff == 1) - return Main.Context.API.GetTranslation("OneMonthAgo"); + return Localize.OneMonthAgo(); if (monthsDiff < 12) - return string.Format(Main.Context.API.GetTranslation("MonthsAgo"), monthsDiff); + return Localize.MonthsAgo(monthsDiff); var yearsDiff = now.Year - fileDateTime.Year; if (now.Month < fileDateTime.Month || (now.Month == fileDateTime.Month && now.Day < fileDateTime.Day)) yearsDiff--; - return yearsDiff == 1 ? Main.Context.API.GetTranslation("OneYearAgo") : - string.Format(Main.Context.API.GetTranslation("YearsAgo"), yearsDiff); + return yearsDiff == 1 ? Localize.OneYearAgo(): Localize.YearsAgo(yearsDiff); } } diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Views/QuickAccessLinkSettings.xaml.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Views/QuickAccessLinkSettings.xaml.cs index e6294b98b..f8929549b 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Views/QuickAccessLinkSettings.xaml.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Views/QuickAccessLinkSettings.xaml.cs @@ -97,7 +97,7 @@ public partial class QuickAccessLinkSettings // Validate the input before proceeding if (string.IsNullOrEmpty(SelectedName) || string.IsNullOrEmpty(SelectedPath)) { - var warning = Main.Context.API.GetTranslation("plugin_explorer_quick_access_link_no_folder_selected"); + var warning = Localize.plugin_explorer_quick_access_link_no_folder_selected(); Main.Context.API.ShowMsgBox(warning); return; } @@ -107,7 +107,7 @@ public partial class QuickAccessLinkSettings x.Path.Equals(SelectedPath, StringComparison.OrdinalIgnoreCase) && x.Name.Equals(SelectedName, StringComparison.OrdinalIgnoreCase))) { - var warning = Main.Context.API.GetTranslation("plugin_explorer_quick_access_link_path_already_exists"); + var warning = Localize.plugin_explorer_quick_access_link_path_already_exists(); Main.Context.API.ShowMsgBox(warning); return; } diff --git a/Plugins/Flow.Launcher.Plugin.PluginIndicator/Flow.Launcher.Plugin.PluginIndicator.csproj b/Plugins/Flow.Launcher.Plugin.PluginIndicator/Flow.Launcher.Plugin.PluginIndicator.csproj index d8db0abe1..9002a3a4a 100644 --- a/Plugins/Flow.Launcher.Plugin.PluginIndicator/Flow.Launcher.Plugin.PluginIndicator.csproj +++ b/Plugins/Flow.Launcher.Plugin.PluginIndicator/Flow.Launcher.Plugin.PluginIndicator.csproj @@ -32,6 +32,7 @@ prompt 4 false + $(NoWarn);FLSG0007 @@ -54,5 +55,9 @@ PreserveNewest + + + + \ No newline at end of file diff --git a/Plugins/Flow.Launcher.Plugin.PluginIndicator/Main.cs b/Plugins/Flow.Launcher.Plugin.PluginIndicator/Main.cs index 48717816b..503d82cc3 100644 --- a/Plugins/Flow.Launcher.Plugin.PluginIndicator/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.PluginIndicator/Main.cs @@ -5,19 +5,19 @@ namespace Flow.Launcher.Plugin.PluginIndicator { public class Main : IPlugin, IPluginI18n, IHomeQuery { - internal PluginInitContext Context { get; private set; } + internal static PluginInitContext Context { get; private set; } + + public void Init(PluginInitContext context) + { + Context = context; + } public List Query(Query query) { return QueryResults(query); } - public List HomeQuery() - { - return QueryResults(); - } - - private List QueryResults(Query query = null) + private static List QueryResults(Query query = null) { var nonGlobalPlugins = GetNonGlobalPlugins(); var querySearch = query?.Search ?? string.Empty; @@ -34,7 +34,7 @@ namespace Flow.Launcher.Plugin.PluginIndicator select new Result { Title = keyword, - SubTitle = string.Format(Context.API.GetTranslation("flowlauncher_plugin_pluginindicator_result_subtitle"), plugin.Name), + SubTitle = Localize.flowlauncher_plugin_pluginindicator_result_subtitle(plugin.Name), Score = score, IcoPath = plugin.IcoPath, AutoCompleteText = $"{keyword}{Plugin.Query.TermSeparator}", @@ -44,10 +44,10 @@ namespace Flow.Launcher.Plugin.PluginIndicator return false; } }; - return results.ToList(); + return [.. results]; } - private Dictionary GetNonGlobalPlugins() + private static Dictionary GetNonGlobalPlugins() { var nonGlobalPlugins = new Dictionary(); foreach (var plugin in Context.API.GetAllPlugins()) @@ -66,19 +66,19 @@ namespace Flow.Launcher.Plugin.PluginIndicator return nonGlobalPlugins; } - public void Init(PluginInitContext context) - { - Context = context; - } - public string GetTranslatedPluginTitle() { - return Context.API.GetTranslation("flowlauncher_plugin_pluginindicator_plugin_name"); + return Localize.flowlauncher_plugin_pluginindicator_plugin_name(); } public string GetTranslatedPluginDescription() { - return Context.API.GetTranslation("flowlauncher_plugin_pluginindicator_plugin_description"); + return Localize.flowlauncher_plugin_pluginindicator_plugin_description(); + } + + public List HomeQuery() + { + return QueryResults(); } } } diff --git a/Plugins/Flow.Launcher.Plugin.ProcessKiller/Flow.Launcher.Plugin.ProcessKiller.csproj b/Plugins/Flow.Launcher.Plugin.ProcessKiller/Flow.Launcher.Plugin.ProcessKiller.csproj index 0a7a02a45..39586771f 100644 --- a/Plugins/Flow.Launcher.Plugin.ProcessKiller/Flow.Launcher.Plugin.ProcessKiller.csproj +++ b/Plugins/Flow.Launcher.Plugin.ProcessKiller/Flow.Launcher.Plugin.ProcessKiller.csproj @@ -35,6 +35,7 @@ prompt 4 false + $(NoWarn);FLSG0007 @@ -52,6 +53,7 @@ + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Plugins/Flow.Launcher.Plugin.ProcessKiller/Main.cs b/Plugins/Flow.Launcher.Plugin.ProcessKiller/Main.cs index 8f5ba4bd2..44746fa62 100644 --- a/Plugins/Flow.Launcher.Plugin.ProcessKiller/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.ProcessKiller/Main.cs @@ -9,19 +9,19 @@ namespace Flow.Launcher.Plugin.ProcessKiller { public class Main : IPlugin, IPluginI18n, IContextMenu, ISettingProvider { + internal static PluginInitContext Context { get; private set; } + + private Settings _settings; + private readonly ProcessHelper processHelper = new(); - private static PluginInitContext _context; - - internal Settings Settings; - private SettingsViewModel _viewModel; public void Init(PluginInitContext context) { - _context = context; - Settings = context.API.LoadSettingJsonStorage(); - _viewModel = new SettingsViewModel(Settings); + Context = context; + _settings = context.API.LoadSettingJsonStorage(); + _viewModel = new SettingsViewModel(_settings); } public List Query(Query query) @@ -31,12 +31,12 @@ namespace Flow.Launcher.Plugin.ProcessKiller public string GetTranslatedPluginTitle() { - return _context.API.GetTranslation("flowlauncher_plugin_processkiller_plugin_name"); + return Localize.flowlauncher_plugin_processkiller_plugin_name(); } public string GetTranslatedPluginDescription() { - return _context.API.GetTranslation("flowlauncher_plugin_processkiller_plugin_description"); + return Localize.flowlauncher_plugin_processkiller_plugin_description(); } public List LoadContextMenus(Result result) @@ -51,13 +51,13 @@ namespace Flow.Launcher.Plugin.ProcessKiller { menuOptions.Add(new Result { - Title = _context.API.GetTranslation("flowlauncher_plugin_processkiller_kill_instances"), + Title = Localize.flowlauncher_plugin_processkiller_kill_instances(), SubTitle = processPath, Action = _ => { foreach (var p in similarProcesses) { - processHelper.TryKill(_context, p); + ProcessHelper.TryKill(p); } return true; @@ -72,8 +72,8 @@ namespace Flow.Launcher.Plugin.ProcessKiller private List CreateResultsFromQuery(Query query) { // Get all non-system processes - var allPocessList = processHelper.GetMatchingProcesses(); - if (!allPocessList.Any()) + var allProcessList = processHelper.GetMatchingProcesses(); + if (allProcessList.Count == 0) { return null; } @@ -82,12 +82,12 @@ namespace Flow.Launcher.Plugin.ProcessKiller var searchTerm = query.Search; var processlist = new List(); var processWindowTitle = - Settings.ShowWindowTitle || Settings.PutVisibleWindowProcessesTop ? + _settings.ShowWindowTitle || _settings.PutVisibleWindowProcessesTop ? ProcessHelper.GetProcessesWithNonEmptyWindowTitle() : - new Dictionary(); + []; if (string.IsNullOrWhiteSpace(searchTerm)) { - foreach (var p in allPocessList) + foreach (var p in allProcessList) { var progressNameIdTitle = ProcessHelper.GetProcessNameIdTitle(p); @@ -97,8 +97,8 @@ namespace Flow.Launcher.Plugin.ProcessKiller // Use window title for those processes if enabled processlist.Add(new ProcessResult( p, - Settings.PutVisibleWindowProcessesTop ? 200 : 0, - Settings.ShowWindowTitle ? windowTitle : progressNameIdTitle, + _settings.PutVisibleWindowProcessesTop ? 200 : 0, + _settings.ShowWindowTitle ? windowTitle : progressNameIdTitle, null, progressNameIdTitle)); } @@ -115,35 +115,35 @@ namespace Flow.Launcher.Plugin.ProcessKiller } else { - foreach (var p in allPocessList) + foreach (var p in allProcessList) { var progressNameIdTitle = ProcessHelper.GetProcessNameIdTitle(p); if (processWindowTitle.TryGetValue(p.Id, out var windowTitle)) { // Get max score from searching process name, window title and process id - var windowTitleMatch = _context.API.FuzzySearch(searchTerm, windowTitle); - var processNameIdMatch = _context.API.FuzzySearch(searchTerm, progressNameIdTitle); + var windowTitleMatch = Context.API.FuzzySearch(searchTerm, windowTitle); + var processNameIdMatch = Context.API.FuzzySearch(searchTerm, progressNameIdTitle); var score = Math.Max(windowTitleMatch.Score, processNameIdMatch.Score); if (score > 0) { // Add score to prioritize processes with visible windows // Use window title for those processes - if (Settings.PutVisibleWindowProcessesTop) + if (_settings.PutVisibleWindowProcessesTop) { score += 200; } processlist.Add(new ProcessResult( p, score, - Settings.ShowWindowTitle ? windowTitle : progressNameIdTitle, + _settings.ShowWindowTitle ? windowTitle : progressNameIdTitle, score == windowTitleMatch.Score ? windowTitleMatch : null, progressNameIdTitle)); } } else { - var processNameIdMatch = _context.API.FuzzySearch(searchTerm, progressNameIdTitle); + var processNameIdMatch = Context.API.FuzzySearch(searchTerm, progressNameIdTitle); var score = processNameIdMatch.Score; if (score > 0) { @@ -162,7 +162,7 @@ namespace Flow.Launcher.Plugin.ProcessKiller foreach (var pr in processlist) { var p = pr.Process; - var path = processHelper.TryGetProcessFilename(p); + var path = ProcessHelper.TryGetProcessFilename(p); results.Add(new Result() { IcoPath = path, @@ -172,12 +172,12 @@ namespace Flow.Launcher.Plugin.ProcessKiller TitleHighlightData = pr.TitleMatch?.MatchData, Score = pr.Score, ContextData = p.ProcessName, - AutoCompleteText = $"{_context.CurrentPluginMetadata.ActionKeyword}{Plugin.Query.TermSeparator}{p.ProcessName}", + AutoCompleteText = $"{Context.CurrentPluginMetadata.ActionKeyword}{Plugin.Query.TermSeparator}{p.ProcessName}", Action = (c) => { - processHelper.TryKill(_context, p); + ProcessHelper.TryKill(p); // Re-query to refresh process list - _context.API.ReQuery(); + Context.API.ReQuery(); return true; } }); @@ -194,17 +194,17 @@ namespace Flow.Launcher.Plugin.ProcessKiller sortedResults.Insert(1, new Result() { IcoPath = firstResult?.IcoPath, - Title = string.Format(_context.API.GetTranslation("flowlauncher_plugin_processkiller_kill_all"), firstResult?.ContextData), - SubTitle = string.Format(_context.API.GetTranslation("flowlauncher_plugin_processkiller_kill_all_count"), processlist.Count), + Title = Localize.flowlauncher_plugin_processkiller_kill_all(firstResult?.ContextData), + SubTitle = Localize.flowlauncher_plugin_processkiller_kill_all_count(processlist.Count), Score = 200, Action = (c) => { foreach (var p in processlist) { - processHelper.TryKill(_context, p.Process); + ProcessHelper.TryKill(p.Process); } // Re-query to refresh process list - _context.API.ReQuery(); + Context.API.ReQuery(); return true; } }); diff --git a/Plugins/Flow.Launcher.Plugin.ProcessKiller/ProcessHelper.cs b/Plugins/Flow.Launcher.Plugin.ProcessKiller/ProcessHelper.cs index cea34f7dc..0e2f78f87 100644 --- a/Plugins/Flow.Launcher.Plugin.ProcessKiller/ProcessHelper.cs +++ b/Plugins/Flow.Launcher.Plugin.ProcessKiller/ProcessHelper.cs @@ -16,8 +16,8 @@ namespace Flow.Launcher.Plugin.ProcessKiller { private static readonly string ClassName = nameof(ProcessHelper); - private readonly HashSet _systemProcessList = new() - { + private readonly HashSet _systemProcessList = + [ "conhost", "svchost", "idle", @@ -31,12 +31,12 @@ namespace Flow.Launcher.Plugin.ProcessKiller "winlogon", "services", "spoolsv", - "explorer" - }; + "explorer" + ]; private const string FlowLauncherProcessName = "Flow.Launcher"; - private bool IsSystemProcessOrFlowLauncher(Process p) => + private bool IsSystemProcessOrFlowLauncher(Process p) => _systemProcessList.Contains(p.ProcessName.ToLower()) || string.Equals(p.ProcessName, FlowLauncherProcessName, StringComparison.OrdinalIgnoreCase); @@ -142,7 +142,7 @@ namespace Flow.Launcher.Plugin.ProcessKiller return Process.GetProcesses().Where(p => !IsSystemProcessOrFlowLauncher(p) && TryGetProcessFilename(p) == processPath); } - public void TryKill(PluginInitContext context, Process p) + public static void TryKill(Process p) { try { @@ -154,11 +154,11 @@ namespace Flow.Launcher.Plugin.ProcessKiller } catch (Exception e) { - context.API.LogException(ClassName, $"Failed to kill process {p.ProcessName}", e); + Main.Context.API.LogException(ClassName, $"Failed to kill process {p.ProcessName}", e); } } - public unsafe string TryGetProcessFilename(Process p) + public static unsafe string TryGetProcessFilename(Process p) { try { diff --git a/Plugins/Flow.Launcher.Plugin.ProcessKiller/ProcessResult.cs b/Plugins/Flow.Launcher.Plugin.ProcessKiller/ProcessResult.cs index 146c9c92c..10a1ebe4a 100644 --- a/Plugins/Flow.Launcher.Plugin.ProcessKiller/ProcessResult.cs +++ b/Plugins/Flow.Launcher.Plugin.ProcessKiller/ProcessResult.cs @@ -3,25 +3,16 @@ using Flow.Launcher.Plugin.SharedModels; namespace Flow.Launcher.Plugin.ProcessKiller { - internal class ProcessResult + internal class ProcessResult(Process process, int score, string title, MatchResult match, string tooltip) { - public ProcessResult(Process process, int score, string title, MatchResult match, string tooltip) - { - Process = process; - Score = score; - Title = title; - TitleMatch = match; - Tooltip = tooltip; - } + public Process Process { get; } = process; - public Process Process { get; } + public int Score { get; } = score; - public int Score { get; } + public string Title { get; } = title; - public string Title { get; } + public MatchResult TitleMatch { get; } = match; - public MatchResult TitleMatch { get; } - - public string Tooltip { get; } + public string Tooltip { get; } = tooltip; } } diff --git a/Plugins/Flow.Launcher.Plugin.ProcessKiller/ViewModels/SettingsViewModel.cs b/Plugins/Flow.Launcher.Plugin.ProcessKiller/ViewModels/SettingsViewModel.cs index 0728d9c0f..02690b9e5 100644 --- a/Plugins/Flow.Launcher.Plugin.ProcessKiller/ViewModels/SettingsViewModel.cs +++ b/Plugins/Flow.Launcher.Plugin.ProcessKiller/ViewModels/SettingsViewModel.cs @@ -1,24 +1,7 @@ namespace Flow.Launcher.Plugin.ProcessKiller.ViewModels { - public class SettingsViewModel + public class SettingsViewModel(Settings settings) { - public Settings Settings { get; set; } - - public SettingsViewModel(Settings settings) - { - Settings = settings; - } - - public bool ShowWindowTitle - { - get => Settings.ShowWindowTitle; - set => Settings.ShowWindowTitle = value; - } - - public bool PutVisibleWindowProcessesTop - { - get => Settings.PutVisibleWindowProcessesTop; - set => Settings.PutVisibleWindowProcessesTop = value; - } + public Settings Settings { get; set; } = settings; } } diff --git a/Plugins/Flow.Launcher.Plugin.ProcessKiller/Views/SettingsControl.xaml b/Plugins/Flow.Launcher.Plugin.ProcessKiller/Views/SettingsControl.xaml index b969be4e8..761570aff 100644 --- a/Plugins/Flow.Launcher.Plugin.ProcessKiller/Views/SettingsControl.xaml +++ b/Plugins/Flow.Launcher.Plugin.ProcessKiller/Views/SettingsControl.xaml @@ -4,6 +4,8 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:vm="clr-namespace:Flow.Launcher.Plugin.ProcessKiller.ViewModels" + d:DataContext="{d:DesignInstance Type=vm:SettingsViewModel}" d:DesignHeight="300" d:DesignWidth="500" mc:Ignorable="d"> @@ -18,11 +20,11 @@ Grid.Row="0" Margin="{StaticResource SettingPanelItemRightTopBottomMargin}" Content="{DynamicResource flowlauncher_plugin_processkiller_show_window_title}" - IsChecked="{Binding ShowWindowTitle}" /> + IsChecked="{Binding Settings.ShowWindowTitle}" /> + IsChecked="{Binding Settings.PutVisibleWindowProcessesTop}" /> \ No newline at end of file diff --git a/Plugins/Flow.Launcher.Plugin.ProcessKiller/Views/SettingsControl.xaml.cs b/Plugins/Flow.Launcher.Plugin.ProcessKiller/Views/SettingsControl.xaml.cs index a066ab6a9..7e712da61 100644 --- a/Plugins/Flow.Launcher.Plugin.ProcessKiller/Views/SettingsControl.xaml.cs +++ b/Plugins/Flow.Launcher.Plugin.ProcessKiller/Views/SettingsControl.xaml.cs @@ -5,9 +5,6 @@ namespace Flow.Launcher.Plugin.ProcessKiller.Views; public partial class SettingsControl : UserControl { - /// - /// Interaction logic for SettingsControl.xaml - /// public SettingsControl(SettingsViewModel viewModel) { InitializeComponent(); diff --git a/Plugins/Flow.Launcher.Plugin.Program/Languages/tr.xaml b/Plugins/Flow.Launcher.Plugin.Program/Languages/tr.xaml index 1316d3fd4..bc508caa1 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Languages/tr.xaml +++ b/Plugins/Flow.Launcher.Plugin.Program/Languages/tr.xaml @@ -67,7 +67,7 @@ Özel URL Protokolleri Özel Dosya Sonekleri - Insert file suffixes you want to index. Suffixes should be separated by ';'. (ex>bat;py) + Dizinlemek istediğiniz dosya uzantılarını girin. Uzantılar ';' ile ayrılmalıdır. (örnek>bat;py) İndekslemek istediğiniz .url dosyalarının protokollerini girin. Protokoller ';' ile ayrılmalı ve "://" ile bitmelidir. (örn>ftp://;mailto://) @@ -86,8 +86,8 @@ Özelleştirilmiş Gezgin Parametreler - You can customize the explorer used for opening the container folder by inputing the Environmental Variable of the explorer you want to use. It will be useful to use CMD to test whether the Environmental Variable is available. - Enter the customized args you want to add for your customized explorer. %s for parent directory, %f for full path (which only works for win32). Check the explorer's website for details. + Kullanmak istediğiniz dosya gezgininin Ortam Değişkenini girerek, konteyner klasörünü açmak için kullanılan gezgini özelleştirebilirsiniz. Ortam Değişkeninin kullanılabilir olup olmadığını test etmek için CMD'yi kullanmak faydalı olacaktır. + Özelleştirilmiş gezgin için eklemek istediğiniz özelleştirilmiş argümanları girin. Üst dizin için %s, tam yol için %f (yalnızca win32 için geçerlidir). Ayrıntılar için gezginin web sitesini kontrol edin. Başarılı diff --git a/Plugins/Flow.Launcher.Plugin.Shell/Converters/LeaveShellOpenOrCloseShellAfterPressEnabledConverter.cs b/Plugins/Flow.Launcher.Plugin.Shell/Converters/LeaveShellOpenOrCloseShellAfterPressEnabledConverter.cs new file mode 100644 index 000000000..5649353e5 --- /dev/null +++ b/Plugins/Flow.Launcher.Plugin.Shell/Converters/LeaveShellOpenOrCloseShellAfterPressEnabledConverter.cs @@ -0,0 +1,25 @@ +using System; +using System.Globalization; +using System.Windows.Data; + +namespace Flow.Launcher.Plugin.Shell.Converters; + +public class LeaveShellOpenOrCloseShellAfterPressEnabledConverter : IMultiValueConverter +{ + public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) + { + if ( + values.Length != 2 || + values[0] is not bool closeShellAfterPressOrLeaveShellOpen || + values[1] is not Shell shell + ) + return Binding.DoNothing; + + return (!closeShellAfterPressOrLeaveShellOpen) && shell != Shell.RunCommand; + } + + public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } +} diff --git a/Plugins/Flow.Launcher.Plugin.Shell/Flow.Launcher.Plugin.Shell.csproj b/Plugins/Flow.Launcher.Plugin.Shell/Flow.Launcher.Plugin.Shell.csproj index 5c3475133..e6932709f 100644 --- a/Plugins/Flow.Launcher.Plugin.Shell/Flow.Launcher.Plugin.Shell.csproj +++ b/Plugins/Flow.Launcher.Plugin.Shell/Flow.Launcher.Plugin.Shell.csproj @@ -34,6 +34,7 @@ prompt 4 false + $(NoWarn);FLSG0007 @@ -58,6 +59,7 @@ + diff --git a/Plugins/Flow.Launcher.Plugin.Shell/Main.cs b/Plugins/Flow.Launcher.Plugin.Shell/Main.cs index a86b96800..25303e9d5 100644 --- a/Plugins/Flow.Launcher.Plugin.Shell/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.Shell/Main.cs @@ -1,13 +1,14 @@ -using System; +using System; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.IO; using System.Linq; using System.Threading.Tasks; +using Flow.Launcher.Plugin.SharedCommands; +using Flow.Launcher.Plugin.Shell.Views; using WindowsInput; using WindowsInput.Native; -using Flow.Launcher.Plugin.SharedCommands; using Control = System.Windows.Controls.Control; using Keys = System.Windows.Forms.Keys; @@ -17,7 +18,7 @@ namespace Flow.Launcher.Plugin.Shell { private static readonly string ClassName = nameof(Main); - internal PluginInitContext Context { get; private set; } + internal static PluginInitContext Context { get; private set; } private const string Image = "Images/shell.png"; private bool _winRStroked; @@ -27,7 +28,7 @@ namespace Flow.Launcher.Plugin.Shell public List Query(Query query) { - List results = new List(); + List results = []; string cmd = query.Search; if (string.IsNullOrEmpty(cmd)) { @@ -45,7 +46,7 @@ namespace Flow.Launcher.Plugin.Shell string basedir = null; string dir = null; string excmd = Environment.ExpandEnvironmentVariables(cmd); - if (Directory.Exists(excmd) && (cmd.EndsWith("/") || cmd.EndsWith(@"\"))) + if (Directory.Exists(excmd) && (cmd.EndsWith('/') || cmd.EndsWith('\\'))) { basedir = excmd; dir = cmd; @@ -54,7 +55,7 @@ namespace Flow.Launcher.Plugin.Shell { basedir = Path.GetDirectoryName(excmd); var dirName = Path.GetDirectoryName(cmd); - dir = (dirName.EndsWith("/") || dirName.EndsWith(@"\")) ? dirName : cmd[..(dirName.Length + 1)]; + dir = (dirName.EndsWith('/') || dirName.EndsWith('\\')) ? dirName : cmd[..(dirName.Length + 1)]; } if (basedir != null) @@ -103,14 +104,14 @@ namespace Flow.Launcher.Plugin.Shell { if (m.Key == cmd) { - result.SubTitle = string.Format(Context.API.GetTranslation("flowlauncher_plugin_cmd_cmd_has_been_executed_times"), m.Value); + result.SubTitle = Localize.flowlauncher_plugin_cmd_cmd_has_been_executed_times(m.Value); return null; } var ret = new Result { Title = m.Key, - SubTitle = string.Format(Context.API.GetTranslation("flowlauncher_plugin_cmd_cmd_has_been_executed_times"), m.Value), + SubTitle = Localize.flowlauncher_plugin_cmd_cmd_has_been_executed_times(m.Value), IcoPath = Image, Action = c => { @@ -129,9 +130,9 @@ namespace Flow.Launcher.Plugin.Shell }).Where(o => o != null); if (_settings.ShowOnlyMostUsedCMDs) - return history.Take(_settings.ShowOnlyMostUsedCMDsNumber).ToList(); + return [.. history.Take(_settings.ShowOnlyMostUsedCMDsNumber)]; - return history.ToList(); + return [.. history]; } private Result GetCurrentCmd(string cmd) @@ -140,7 +141,7 @@ namespace Flow.Launcher.Plugin.Shell { Title = cmd, Score = 5000, - SubTitle = Context.API.GetTranslation("flowlauncher_plugin_cmd_execute_through_shell"), + SubTitle = Localize.flowlauncher_plugin_cmd_execute_through_shell(), IcoPath = Image, Action = c => { @@ -165,7 +166,7 @@ namespace Flow.Launcher.Plugin.Shell .Select(m => new Result { Title = m.Key, - SubTitle = string.Format(Context.API.GetTranslation("flowlauncher_plugin_cmd_cmd_has_been_executed_times"), m.Value), + SubTitle = Localize.flowlauncher_plugin_cmd_cmd_has_been_executed_times(m.Value), IcoPath = Image, Action = c => { @@ -182,9 +183,9 @@ namespace Flow.Launcher.Plugin.Shell }); if (_settings.ShowOnlyMostUsedCMDs) - return history.Take(_settings.ShowOnlyMostUsedCMDsNumber).ToList(); + return [.. history.Take(_settings.ShowOnlyMostUsedCMDsNumber)]; - return history.ToList(); + return [.. history]; } private ProcessStartInfo PrepareProcessStartInfo(string command, bool runAsAdministrator = false) @@ -199,7 +200,7 @@ namespace Flow.Launcher.Plugin.Shell Verb = runAsAdministratorArg, WorkingDirectory = workingDirectory, }; - var notifyStr = Context.API.GetTranslation("flowlauncher_plugin_cmd_press_any_key_to_close"); + var notifyStr = Localize.flowlauncher_plugin_cmd_press_any_key_to_close(); var addedCharacter = _settings.UseWindowsTerminal ? "\\" : ""; switch (_settings.Shell) { @@ -288,10 +289,10 @@ namespace Flow.Launcher.Plugin.Shell case Shell.RunCommand: { - var parts = command.Split(new[] - { + var parts = command.Split( + [ ' ' - }, 2); + ], 2); if (parts.Length == 2) { var filename = parts[0]; @@ -336,12 +337,12 @@ namespace Flow.Launcher.Plugin.Shell catch (FileNotFoundException e) { Context.API.ShowMsgError(GetTranslatedPluginTitle(), - string.Format(Context.API.GetTranslation("flowlauncher_plugin_cmd_command_not_found"), e.Message)); + Localize.flowlauncher_plugin_cmd_command_not_found(e.Message)); } catch (Win32Exception e) { Context.API.ShowMsgError(GetTranslatedPluginTitle(), - string.Format(Context.API.GetTranslation("flowlauncher_plugin_cmd_error_running_command"), e.Message)); + Localize.flowlauncher_plugin_cmd_error_running_command(e.Message)); } catch (Exception e) { @@ -383,9 +384,16 @@ namespace Flow.Launcher.Plugin.Shell Context = context; _settings = context.API.LoadSettingJsonStorage(); context.API.RegisterGlobalKeyboardCallback(API_GlobalKeyboardEvent); + // Since the old Settings class set default value of ShowOnlyMostUsedCMDsNumber to 0 which is a wrong value, + // we need to fix it here to make sure the default value is 5 + // todo: remove this code block after release v2.2.0 + if (_settings.ShowOnlyMostUsedCMDsNumber == 0) + { + _settings.ShowOnlyMostUsedCMDsNumber = 5; + } } - bool API_GlobalKeyboardEvent(int keyevent, int vkcode, SpecialKeyState state) + private bool API_GlobalKeyboardEvent(int keyevent, int vkcode, SpecialKeyState state) { if (!Context.CurrentPluginMetadata.Disabled && _settings.ReplaceWinR) { @@ -405,7 +413,7 @@ namespace Flow.Launcher.Plugin.Shell return true; } - private void OnWinRPressed() + private static void OnWinRPressed() { Context.API.ShowMainWindow(); // show the main window and set focus to the query box @@ -428,12 +436,12 @@ namespace Flow.Launcher.Plugin.Shell public string GetTranslatedPluginTitle() { - return Context.API.GetTranslation("flowlauncher_plugin_cmd_plugin_name"); + return Localize.flowlauncher_plugin_cmd_plugin_name(); } public string GetTranslatedPluginDescription() { - return Context.API.GetTranslation("flowlauncher_plugin_cmd_plugin_description"); + return Localize.flowlauncher_plugin_cmd_plugin_description(); } public List LoadContextMenus(Result selectedResult) @@ -442,7 +450,7 @@ namespace Flow.Launcher.Plugin.Shell { new() { - Title = Context.API.GetTranslation("flowlauncher_plugin_cmd_run_as_different_user"), + Title = Localize.flowlauncher_plugin_cmd_run_as_different_user(), Action = c => { Execute(ShellCommand.RunAsDifferentUser, PrepareProcessStartInfo(selectedResult.Title)); @@ -453,7 +461,7 @@ namespace Flow.Launcher.Plugin.Shell }, new() { - Title = Context.API.GetTranslation("flowlauncher_plugin_cmd_run_as_administrator"), + Title = Localize.flowlauncher_plugin_cmd_run_as_administrator(), Action = c => { Execute(Process.Start, PrepareProcessStartInfo(selectedResult.Title, true)); @@ -464,7 +472,7 @@ namespace Flow.Launcher.Plugin.Shell }, new() { - Title = Context.API.GetTranslation("flowlauncher_plugin_cmd_copy"), + Title = Localize.flowlauncher_plugin_cmd_copy(), Action = c => { Context.API.CopyToClipboard(selectedResult.Title); diff --git a/Plugins/Flow.Launcher.Plugin.Shell/Settings.cs b/Plugins/Flow.Launcher.Plugin.Shell/Settings.cs index 9ce2293a2..79a906534 100644 --- a/Plugins/Flow.Launcher.Plugin.Shell/Settings.cs +++ b/Plugins/Flow.Launcher.Plugin.Shell/Settings.cs @@ -1,45 +1,146 @@ using System.Collections.Generic; +using Flow.Launcher.Localization.Attributes; namespace Flow.Launcher.Plugin.Shell { - public class Settings + public class Settings : BaseModel { - public Shell Shell { get; set; } = Shell.Cmd; - - public bool ReplaceWinR { get; set; } = false; + private Shell _shell = Shell.Cmd; + public Shell Shell + { + get => _shell; + set + { + if (_shell != value) + { + _shell = value; + OnPropertyChanged(); + } + } + } - public bool CloseShellAfterPress { get; set; } = false; - - public bool LeaveShellOpen { get; set; } + private bool _replaceWinR = false; + public bool ReplaceWinR + { + get => _replaceWinR; + set + { + if (_replaceWinR != value) + { + _replaceWinR = value; + OnPropertyChanged(); + } + } + } - public bool RunAsAdministrator { get; set; } = true; + private bool _closeShellAfterPress = false; + public bool CloseShellAfterPress + { + get => _closeShellAfterPress; + set + { + if (_closeShellAfterPress != value) + { + _closeShellAfterPress = value; + OnPropertyChanged(); + } + } + } - public bool UseWindowsTerminal { get; set; } = false; + private bool _leaveShellOpen; + public bool LeaveShellOpen + { + get => _leaveShellOpen; + set + { + if (_leaveShellOpen != value) + { + _leaveShellOpen = value; + OnPropertyChanged(); + } + } + } - public bool ShowOnlyMostUsedCMDs { get; set; } + private bool _runAsAdministrator = true; + public bool RunAsAdministrator + { + get => _runAsAdministrator; + set + { + if (_runAsAdministrator != value) + { + _runAsAdministrator = value; + OnPropertyChanged(); + } + } + } - public int ShowOnlyMostUsedCMDsNumber { get; set; } + private bool _useWindowsTerminal = false; + public bool UseWindowsTerminal + { + get => _useWindowsTerminal; + set + { + if (_useWindowsTerminal != value) + { + _useWindowsTerminal = value; + OnPropertyChanged(); + } + } + } - public Dictionary CommandHistory { get; set; } = new Dictionary(); + private bool _showOnlyMostUsedCMDs; + public bool ShowOnlyMostUsedCMDs + { + get => _showOnlyMostUsedCMDs; + set + { + if (_showOnlyMostUsedCMDs != value) + { + _showOnlyMostUsedCMDs = value; + OnPropertyChanged(); + } + } + } + + private int _showOnlyMostUsedCMDsNumber = 5; + public int ShowOnlyMostUsedCMDsNumber + { + get => _showOnlyMostUsedCMDsNumber; + set + { + if (_showOnlyMostUsedCMDsNumber != value) + { + _showOnlyMostUsedCMDsNumber = value; + OnPropertyChanged(); + } + } + } + + public Dictionary CommandHistory { get; set; } = []; public void AddCmdHistory(string cmdName) { - if (CommandHistory.ContainsKey(cmdName)) + if (!CommandHistory.TryAdd(cmdName, 1)) { CommandHistory[cmdName] += 1; } - else - { - CommandHistory.Add(cmdName, 1); - } } } + [EnumLocalize] public enum Shell { + [EnumLocalizeValue("CMD")] Cmd = 0, + + [EnumLocalizeValue("PowerShell")] Powershell = 1, + + [EnumLocalizeValue("RunCommand")] RunCommand = 2, + + [EnumLocalizeValue("Pwsh")] Pwsh = 3, } } diff --git a/Plugins/Flow.Launcher.Plugin.Shell/ShellSetting.xaml.cs b/Plugins/Flow.Launcher.Plugin.Shell/ShellSetting.xaml.cs deleted file mode 100644 index d87c6c7bf..000000000 --- a/Plugins/Flow.Launcher.Plugin.Shell/ShellSetting.xaml.cs +++ /dev/null @@ -1,143 +0,0 @@ -using System.Collections.Generic; -using System.Windows; -using System.Windows.Controls; - -namespace Flow.Launcher.Plugin.Shell -{ - public partial class CMDSetting : UserControl - { - private readonly Settings _settings; - - public CMDSetting(Settings settings) - { - InitializeComponent(); - _settings = settings; - } - - private void CMDSetting_OnLoaded(object sender, RoutedEventArgs re) - { - ReplaceWinR.IsChecked = _settings.ReplaceWinR; - - CloseShellAfterPress.IsChecked = _settings.CloseShellAfterPress; - - LeaveShellOpen.IsChecked = _settings.LeaveShellOpen; - - AlwaysRunAsAdministrator.IsChecked = _settings.RunAsAdministrator; - - UseWindowsTerminal.IsChecked = _settings.UseWindowsTerminal; - - LeaveShellOpen.IsEnabled = _settings.Shell != Shell.RunCommand; - - ShowOnlyMostUsedCMDs.IsChecked = _settings.ShowOnlyMostUsedCMDs; - - if ((bool)!ShowOnlyMostUsedCMDs.IsChecked) - ShowOnlyMostUsedCMDsNumber.IsEnabled = false; - - ShowOnlyMostUsedCMDsNumber.ItemsSource = new List() { 5, 10, 20 }; - - if (_settings.ShowOnlyMostUsedCMDsNumber == 0) - { - ShowOnlyMostUsedCMDsNumber.SelectedIndex = 0; - - _settings.ShowOnlyMostUsedCMDsNumber = (int)ShowOnlyMostUsedCMDsNumber.SelectedItem; - } - - CloseShellAfterPress.Checked += (o, e) => - { - _settings.CloseShellAfterPress = true; - LeaveShellOpen.IsChecked = false; - LeaveShellOpen.IsEnabled = false; - }; - - CloseShellAfterPress.Unchecked += (o, e) => - { - _settings.CloseShellAfterPress = false; - LeaveShellOpen.IsEnabled = true; - }; - - LeaveShellOpen.Checked += (o, e) => - { - _settings.LeaveShellOpen = true; - CloseShellAfterPress.IsChecked = false; - CloseShellAfterPress.IsEnabled = false; - }; - - LeaveShellOpen.Unchecked += (o, e) => - { - _settings.LeaveShellOpen = false; - CloseShellAfterPress.IsEnabled = true; - }; - - AlwaysRunAsAdministrator.Checked += (o, e) => - { - _settings.RunAsAdministrator = true; - }; - - AlwaysRunAsAdministrator.Unchecked += (o, e) => - { - _settings.RunAsAdministrator = false; - }; - - UseWindowsTerminal.Checked += (o, e) => - { - _settings.UseWindowsTerminal = true; - }; - - UseWindowsTerminal.Unchecked += (o, e) => - { - _settings.UseWindowsTerminal = false; - }; - - ReplaceWinR.Checked += (o, e) => - { - _settings.ReplaceWinR = true; - }; - - ReplaceWinR.Unchecked += (o, e) => - { - _settings.ReplaceWinR = false; - }; - - ShellComboBox.SelectedIndex = _settings.Shell switch - { - Shell.Cmd => 0, - Shell.Powershell => 1, - Shell.Pwsh => 2, - _ => ShellComboBox.Items.Count - 1 - }; - - ShellComboBox.SelectionChanged += (o, e) => - { - _settings.Shell = ShellComboBox.SelectedIndex switch - { - 0 => Shell.Cmd, - 1 => Shell.Powershell, - 2 => Shell.Pwsh, - _ => Shell.RunCommand - }; - LeaveShellOpen.IsEnabled = _settings.Shell != Shell.RunCommand; - }; - - ShowOnlyMostUsedCMDs.Checked += (o, e) => - { - _settings.ShowOnlyMostUsedCMDs = true; - - ShowOnlyMostUsedCMDsNumber.IsEnabled = true; - }; - - ShowOnlyMostUsedCMDs.Unchecked += (o, e) => - { - _settings.ShowOnlyMostUsedCMDs = false; - - ShowOnlyMostUsedCMDsNumber.IsEnabled = false; - }; - - ShowOnlyMostUsedCMDsNumber.SelectedItem = _settings.ShowOnlyMostUsedCMDsNumber; - ShowOnlyMostUsedCMDsNumber.SelectionChanged += (o, e) => - { - _settings.ShowOnlyMostUsedCMDsNumber = (int)ShowOnlyMostUsedCMDsNumber.SelectedItem; - }; - - } - } -} diff --git a/Plugins/Flow.Launcher.Plugin.Shell/ViewModels/ShellSettingViewModel.cs b/Plugins/Flow.Launcher.Plugin.Shell/ViewModels/ShellSettingViewModel.cs new file mode 100644 index 000000000..341fc3868 --- /dev/null +++ b/Plugins/Flow.Launcher.Plugin.Shell/ViewModels/ShellSettingViewModel.cs @@ -0,0 +1,78 @@ +using System.Collections.Generic; + +namespace Flow.Launcher.Plugin.Shell.ViewModels; + +public class ShellSettingViewModel : BaseModel +{ + public Settings Settings { get; } + + public List AllShells { get; } = ShellLocalized.GetValues(); + + public Shell SelectedShell + { + get => Settings.Shell; + set + { + if (Settings.Shell != value) + { + Settings.Shell = value; + OnPropertyChanged(); + } + } + } + + public List OnlyMostUsedCMDsNumbers { get; } = [5, 10, 20]; + public int SelectedOnlyMostUsedCMDsNumber + { + get => Settings.ShowOnlyMostUsedCMDsNumber; + set + { + if (Settings.ShowOnlyMostUsedCMDsNumber != value) + { + Settings.ShowOnlyMostUsedCMDsNumber = value; + OnPropertyChanged(); + } + } + } + + public bool CloseShellAfterPress + { + get => Settings.CloseShellAfterPress; + set + { + if (Settings.CloseShellAfterPress != value) + { + Settings.CloseShellAfterPress = value; + OnPropertyChanged(); + // Only allow CloseShellAfterPress to be true when LeaveShellOpen is false + if (value) + { + LeaveShellOpen = false; + } + } + } + } + + public bool LeaveShellOpen + { + get => Settings.LeaveShellOpen; + set + { + if (Settings.LeaveShellOpen != value) + { + Settings.LeaveShellOpen = value; + OnPropertyChanged(); + // Only allow LeaveShellOpen to be true when CloseShellAfterPress is false + if (value) + { + CloseShellAfterPress = false; + } + } + } + } + + public ShellSettingViewModel(Settings settings) + { + Settings = settings; + } +} diff --git a/Plugins/Flow.Launcher.Plugin.Shell/ShellSetting.xaml b/Plugins/Flow.Launcher.Plugin.Shell/Views/ShellSetting.xaml similarity index 53% rename from Plugins/Flow.Launcher.Plugin.Shell/ShellSetting.xaml rename to Plugins/Flow.Launcher.Plugin.Shell/Views/ShellSetting.xaml index 32f2ad69c..5f66884ea 100644 --- a/Plugins/Flow.Launcher.Plugin.Shell/ShellSetting.xaml +++ b/Plugins/Flow.Launcher.Plugin.Shell/Views/ShellSetting.xaml @@ -1,13 +1,19 @@  + + + + @@ -23,50 +29,72 @@ Grid.Row="0" Margin="{StaticResource SettingPanelItemRightTopBottomMargin}" HorizontalAlignment="Left" - Content="{DynamicResource flowlauncher_plugin_cmd_relace_winr}" /> + Content="{DynamicResource flowlauncher_plugin_cmd_relace_winr}" + IsChecked="{Binding Settings.ReplaceWinR, Mode=TwoWay}" /> + Content="{DynamicResource flowlauncher_plugin_cmd_close_cmd_after_press}" + IsChecked="{Binding CloseShellAfterPress, Mode=TwoWay}"> + + + + + + + + Content="{DynamicResource flowlauncher_plugin_cmd_leave_cmd_open}" + IsChecked="{Binding LeaveShellOpen, Mode=TwoWay}"> + + + + + + + + Content="{DynamicResource flowlauncher_plugin_cmd_always_run_as_administrator}" + IsChecked="{Binding Settings.RunAsAdministrator, Mode=TwoWay}" /> + Content="{DynamicResource flowlauncher_plugin_cmd_use_windows_terminal}" + IsChecked="{Binding Settings.UseWindowsTerminal, Mode=TwoWay}" /> - CMD - PowerShell - Pwsh - RunCommand - + HorizontalAlignment="Left" + DisplayMemberPath="Display" + ItemsSource="{Binding AllShells, Mode=OneTime}" + SelectedValue="{Binding SelectedShell, Mode=TwoWay}" + SelectedValuePath="Value" /> + Content="{DynamicResource flowlauncher_plugin_cmd_history}" + IsChecked="{Binding Settings.ShowOnlyMostUsedCMDs, Mode=TwoWay}" /> + HorizontalAlignment="Left" + IsEnabled="{Binding Settings.ShowOnlyMostUsedCMDs, Mode=OneWay}" + ItemsSource="{Binding OnlyMostUsedCMDsNumbers, Mode=OneTime}" + SelectedItem="{Binding SelectedOnlyMostUsedCMDsNumber, Mode=TwoWay}" /> diff --git a/Plugins/Flow.Launcher.Plugin.Shell/Views/ShellSetting.xaml.cs b/Plugins/Flow.Launcher.Plugin.Shell/Views/ShellSetting.xaml.cs new file mode 100644 index 000000000..c656ea070 --- /dev/null +++ b/Plugins/Flow.Launcher.Plugin.Shell/Views/ShellSetting.xaml.cs @@ -0,0 +1,15 @@ +using System.Windows.Controls; +using Flow.Launcher.Plugin.Shell.ViewModels; + +namespace Flow.Launcher.Plugin.Shell.Views +{ + public partial class CMDSetting : UserControl + { + public CMDSetting(Settings settings) + { + var viewModel = new ShellSettingViewModel(settings); + DataContext = viewModel; + InitializeComponent(); + } + } +} diff --git a/Plugins/Flow.Launcher.Plugin.Sys/CommandKeywordSetting.xaml.cs b/Plugins/Flow.Launcher.Plugin.Sys/CommandKeywordSetting.xaml.cs index 8797bf220..d0669252d 100644 --- a/Plugins/Flow.Launcher.Plugin.Sys/CommandKeywordSetting.xaml.cs +++ b/Plugins/Flow.Launcher.Plugin.Sys/CommandKeywordSetting.xaml.cs @@ -5,15 +5,13 @@ namespace Flow.Launcher.Plugin.Sys public partial class CommandKeywordSettingWindow { private readonly Command _oldSearchSource; - private readonly PluginInitContext _context; - public CommandKeywordSettingWindow(PluginInitContext context, Command old) + public CommandKeywordSettingWindow(Command old) { - _context = context; _oldSearchSource = old; InitializeComponent(); CommandKeyword.Text = old.Keyword; - CommandKeywordTips.Text = string.Format(_context.API.GetTranslation("flowlauncher_plugin_sys_custom_command_keyword_tip"), old.Name); + CommandKeywordTips.Text = Localize.flowlauncher_plugin_sys_custom_command_keyword_tip(old.Name); } private void OnCancelButtonClick(object sender, RoutedEventArgs e) @@ -26,8 +24,8 @@ namespace Flow.Launcher.Plugin.Sys var keyword = CommandKeyword.Text; if (string.IsNullOrEmpty(keyword)) { - var warning = _context.API.GetTranslation("flowlauncher_plugin_sys_input_command_keyword"); - _context.API.ShowMsgBox(warning); + var warning = Localize.flowlauncher_plugin_sys_input_command_keyword(); + Main.Context.API.ShowMsgBox(warning); } else { diff --git a/Plugins/Flow.Launcher.Plugin.Sys/Flow.Launcher.Plugin.Sys.csproj b/Plugins/Flow.Launcher.Plugin.Sys/Flow.Launcher.Plugin.Sys.csproj index 44fc9a8cf..4cf09baab 100644 --- a/Plugins/Flow.Launcher.Plugin.Sys/Flow.Launcher.Plugin.Sys.csproj +++ b/Plugins/Flow.Launcher.Plugin.Sys/Flow.Launcher.Plugin.Sys.csproj @@ -34,6 +34,7 @@ prompt 4 false + $(NoWarn);FLSG0007 @@ -58,6 +59,7 @@ + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Plugins/Flow.Launcher.Plugin.Sys/Languages/ar.xaml b/Plugins/Flow.Launcher.Plugin.Sys/Languages/ar.xaml index ac45e013e..b28bd4d9b 100644 --- a/Plugins/Flow.Launcher.Plugin.Sys/Languages/ar.xaml +++ b/Plugins/Flow.Launcher.Plugin.Sys/Languages/ar.xaml @@ -76,4 +76,9 @@ أوامر النظام يوفر أوامر متعلقة بالنظام، مثل إيقاف التشغيل، القفل، الإعدادات، وما إلى ذلك. + + This theme supports two (light/dark) modes and Blur Transparent Background + This theme supports two (light/dark) modes + This theme supports Blur Transparent Background + diff --git a/Plugins/Flow.Launcher.Plugin.Sys/Languages/cs.xaml b/Plugins/Flow.Launcher.Plugin.Sys/Languages/cs.xaml index 6af81c3a5..a88f113e3 100644 --- a/Plugins/Flow.Launcher.Plugin.Sys/Languages/cs.xaml +++ b/Plugins/Flow.Launcher.Plugin.Sys/Languages/cs.xaml @@ -76,4 +76,9 @@ Systémové příkazy Poskytuje příkazy související se systémem, jako je vypnutí, uzamčení počítače atd. + + This theme supports two (light/dark) modes and Blur Transparent Background + This theme supports two (light/dark) modes + This theme supports Blur Transparent Background + diff --git a/Plugins/Flow.Launcher.Plugin.Sys/Languages/da.xaml b/Plugins/Flow.Launcher.Plugin.Sys/Languages/da.xaml index 4a910b381..944d5c679 100644 --- a/Plugins/Flow.Launcher.Plugin.Sys/Languages/da.xaml +++ b/Plugins/Flow.Launcher.Plugin.Sys/Languages/da.xaml @@ -76,4 +76,9 @@ System Commands Provides System related commands. e.g. shutdown, lock, settings etc. + + This theme supports two (light/dark) modes and Blur Transparent Background + This theme supports two (light/dark) modes + This theme supports Blur Transparent Background + diff --git a/Plugins/Flow.Launcher.Plugin.Sys/Languages/de.xaml b/Plugins/Flow.Launcher.Plugin.Sys/Languages/de.xaml index 469928a29..8ef862199 100644 --- a/Plugins/Flow.Launcher.Plugin.Sys/Languages/de.xaml +++ b/Plugins/Flow.Launcher.Plugin.Sys/Languages/de.xaml @@ -76,4 +76,9 @@ Systembefehle Bietet systembezogene Befehle, z. B. Herunterfahren, Sperren, Einstellungen etc. + + This theme supports two (light/dark) modes and Blur Transparent Background + This theme supports two (light/dark) modes + This theme supports Blur Transparent Background + diff --git a/Plugins/Flow.Launcher.Plugin.Sys/Languages/en.xaml b/Plugins/Flow.Launcher.Plugin.Sys/Languages/en.xaml index 56899eef3..9e9a2f93d 100644 --- a/Plugins/Flow.Launcher.Plugin.Sys/Languages/en.xaml +++ b/Plugins/Flow.Launcher.Plugin.Sys/Languages/en.xaml @@ -78,4 +78,9 @@ System Commands Provides System related commands. e.g. shutdown, lock, settings etc. + + This theme supports two (light/dark) modes and Blur Transparent Background + This theme supports two (light/dark) modes + This theme supports Blur Transparent Background + diff --git a/Plugins/Flow.Launcher.Plugin.Sys/Languages/es-419.xaml b/Plugins/Flow.Launcher.Plugin.Sys/Languages/es-419.xaml index 7fa6fdb7b..7587fab43 100644 --- a/Plugins/Flow.Launcher.Plugin.Sys/Languages/es-419.xaml +++ b/Plugins/Flow.Launcher.Plugin.Sys/Languages/es-419.xaml @@ -76,4 +76,9 @@ System Commands Provides System related commands. e.g. shutdown, lock, settings etc. + + This theme supports two (light/dark) modes and Blur Transparent Background + This theme supports two (light/dark) modes + This theme supports Blur Transparent Background + diff --git a/Plugins/Flow.Launcher.Plugin.Sys/Languages/es.xaml b/Plugins/Flow.Launcher.Plugin.Sys/Languages/es.xaml index 0db2d60d5..55d3f457a 100644 --- a/Plugins/Flow.Launcher.Plugin.Sys/Languages/es.xaml +++ b/Plugins/Flow.Launcher.Plugin.Sys/Languages/es.xaml @@ -76,4 +76,9 @@ Comandos del sistema Proporciona comandos relacionados con el sistema. Por ejemplo, apagar, bloquear, configurar, etc. + + Este tema admite dos modos (claro/oscuro) y fondo transparente desenfocado + Este tema admite dos modos (claro/oscuro) + Este tema admite fondo transparente desenfocado + diff --git a/Plugins/Flow.Launcher.Plugin.Sys/Languages/fr.xaml b/Plugins/Flow.Launcher.Plugin.Sys/Languages/fr.xaml index 3a15b69a4..6b46ca9dd 100644 --- a/Plugins/Flow.Launcher.Plugin.Sys/Languages/fr.xaml +++ b/Plugins/Flow.Launcher.Plugin.Sys/Languages/fr.xaml @@ -76,4 +76,9 @@ Commandes système Fournit des commandes liées au système. Par exemple, arrêt, verrouillage, paramètres, etc. + + Ce thème prend en charge deux modes (clair / sombre) et un fond transparent flou + Ce thème prend en charge deux modes (clair / sombre) + Ce thème prend en charge un fond transparent flou + diff --git a/Plugins/Flow.Launcher.Plugin.Sys/Languages/he.xaml b/Plugins/Flow.Launcher.Plugin.Sys/Languages/he.xaml index caf82072c..6bd87b60c 100644 --- a/Plugins/Flow.Launcher.Plugin.Sys/Languages/he.xaml +++ b/Plugins/Flow.Launcher.Plugin.Sys/Languages/he.xaml @@ -76,4 +76,9 @@ פקודות מערכת מספק פקודות הקשורות למערכת, כגון כיבוי, נעילה, הגדרות ועוד. + + This theme supports two (light/dark) modes and Blur Transparent Background + This theme supports two (light/dark) modes + This theme supports Blur Transparent Background + diff --git a/Plugins/Flow.Launcher.Plugin.Sys/Languages/it.xaml b/Plugins/Flow.Launcher.Plugin.Sys/Languages/it.xaml index f1d11c156..5212a8ce6 100644 --- a/Plugins/Flow.Launcher.Plugin.Sys/Languages/it.xaml +++ b/Plugins/Flow.Launcher.Plugin.Sys/Languages/it.xaml @@ -76,4 +76,9 @@ Comandi di Sistema Fornisce comandi relativi al sistema, ad esempio spegnimento, blocco, impostazioni ecc. + + This theme supports two (light/dark) modes and Blur Transparent Background + This theme supports two (light/dark) modes + This theme supports Blur Transparent Background + diff --git a/Plugins/Flow.Launcher.Plugin.Sys/Languages/ja.xaml b/Plugins/Flow.Launcher.Plugin.Sys/Languages/ja.xaml index 00aa91fb9..a62c09300 100644 --- a/Plugins/Flow.Launcher.Plugin.Sys/Languages/ja.xaml +++ b/Plugins/Flow.Launcher.Plugin.Sys/Languages/ja.xaml @@ -18,7 +18,7 @@ ごみ箱を開く 終了 設定を保存 - Flow Launcherを再起動する + Flow Launcherを再起動 設定 プラグインデータのリロード 更新を確認 @@ -76,4 +76,9 @@ システムコマンド システム関連のコマンドを提供します。例:シャットダウン、ロック、設定など + + このテーマは2つのモード(明るい/暗い)と透明な背景をぼかし効果が使用できます + このテーマはライト/ダークの2モードに対応しています + このテーマは背景のぼかした透明効果をサポートしています + diff --git a/Plugins/Flow.Launcher.Plugin.Sys/Languages/ko.xaml b/Plugins/Flow.Launcher.Plugin.Sys/Languages/ko.xaml index 909b4a40b..b0c74748d 100644 --- a/Plugins/Flow.Launcher.Plugin.Sys/Languages/ko.xaml +++ b/Plugins/Flow.Launcher.Plugin.Sys/Languages/ko.xaml @@ -76,4 +76,9 @@ 시스템 명령어 시스템 종료, 컴퓨터 잠금, 설정 등과 같은 시스템 관련 명령어를 제공합니다 + + This theme supports two (light/dark) modes and Blur Transparent Background + This theme supports two (light/dark) modes + This theme supports Blur Transparent Background + diff --git a/Plugins/Flow.Launcher.Plugin.Sys/Languages/nb.xaml b/Plugins/Flow.Launcher.Plugin.Sys/Languages/nb.xaml index 4072a7454..9c5ea839e 100644 --- a/Plugins/Flow.Launcher.Plugin.Sys/Languages/nb.xaml +++ b/Plugins/Flow.Launcher.Plugin.Sys/Languages/nb.xaml @@ -76,4 +76,9 @@ Systemkommandoer Gir systemrelaterte kommandoer, f.eks. slå av, lås, innstillinger osv. + + This theme supports two (light/dark) modes and Blur Transparent Background + This theme supports two (light/dark) modes + This theme supports Blur Transparent Background + diff --git a/Plugins/Flow.Launcher.Plugin.Sys/Languages/nl.xaml b/Plugins/Flow.Launcher.Plugin.Sys/Languages/nl.xaml index e24a4b6f7..9e1c18a30 100644 --- a/Plugins/Flow.Launcher.Plugin.Sys/Languages/nl.xaml +++ b/Plugins/Flow.Launcher.Plugin.Sys/Languages/nl.xaml @@ -76,4 +76,9 @@ Systeemopdrachten Voorziet in systeem gerelateerde opdrachten. bijv.: afsluiten, vergrendelen, instellingen, enz. + + This theme supports two (light/dark) modes and Blur Transparent Background + This theme supports two (light/dark) modes + This theme supports Blur Transparent Background + diff --git a/Plugins/Flow.Launcher.Plugin.Sys/Languages/pl.xaml b/Plugins/Flow.Launcher.Plugin.Sys/Languages/pl.xaml index 8532d4a99..5aa8e054c 100644 --- a/Plugins/Flow.Launcher.Plugin.Sys/Languages/pl.xaml +++ b/Plugins/Flow.Launcher.Plugin.Sys/Languages/pl.xaml @@ -76,4 +76,9 @@ Komendy systemowe Wykonywanie komend systemowych, np. wyłącz, zablokuj komputer, otwórz ustawienia itp. + + This theme supports two (light/dark) modes and Blur Transparent Background + This theme supports two (light/dark) modes + This theme supports Blur Transparent Background + diff --git a/Plugins/Flow.Launcher.Plugin.Sys/Languages/pt-br.xaml b/Plugins/Flow.Launcher.Plugin.Sys/Languages/pt-br.xaml index fb0fde730..95639b82f 100644 --- a/Plugins/Flow.Launcher.Plugin.Sys/Languages/pt-br.xaml +++ b/Plugins/Flow.Launcher.Plugin.Sys/Languages/pt-br.xaml @@ -76,4 +76,9 @@ System Commands Provides System related commands. e.g. shutdown, lock, settings etc. + + This theme supports two (light/dark) modes and Blur Transparent Background + This theme supports two (light/dark) modes + This theme supports Blur Transparent Background + diff --git a/Plugins/Flow.Launcher.Plugin.Sys/Languages/pt-pt.xaml b/Plugins/Flow.Launcher.Plugin.Sys/Languages/pt-pt.xaml index 6021c96ff..a3a1411dc 100644 --- a/Plugins/Flow.Launcher.Plugin.Sys/Languages/pt-pt.xaml +++ b/Plugins/Flow.Launcher.Plugin.Sys/Languages/pt-pt.xaml @@ -76,4 +76,9 @@ Comandos do sistema Disponibiliza os comandos relacionados com o sistema tais como: desligar, bloquear, reiniciar... + + Este tema tem suporte a dois modos (claro/escuro) e fundo transparente + Este tema tem suporte a dois modos (claro/escuro) + Este tema tem suporte a fundo transparente desfocado + diff --git a/Plugins/Flow.Launcher.Plugin.Sys/Languages/ru.xaml b/Plugins/Flow.Launcher.Plugin.Sys/Languages/ru.xaml index 0313a7918..cd5cc111b 100644 --- a/Plugins/Flow.Launcher.Plugin.Sys/Languages/ru.xaml +++ b/Plugins/Flow.Launcher.Plugin.Sys/Languages/ru.xaml @@ -76,4 +76,9 @@ Системные команды Provides System related commands. e.g. shutdown, lock, settings etc. + + This theme supports two (light/dark) modes and Blur Transparent Background + This theme supports two (light/dark) modes + This theme supports Blur Transparent Background + diff --git a/Plugins/Flow.Launcher.Plugin.Sys/Languages/sk.xaml b/Plugins/Flow.Launcher.Plugin.Sys/Languages/sk.xaml index f4823dc57..0a9ce9bbd 100644 --- a/Plugins/Flow.Launcher.Plugin.Sys/Languages/sk.xaml +++ b/Plugins/Flow.Launcher.Plugin.Sys/Languages/sk.xaml @@ -76,4 +76,9 @@ Systémové príkazy Poskytuje príkazy súvisiace so systémom ako je vypnutie, uzamknutie počítača atď. + + Tento motív podporuje 2 režimy (svetlý/tmavý) a rozostrenie priehľadného pozadia + Tento motív podporuje 2 režimy (svetlý/tmavý) + Tento motív podporuje rozostrenie priehľadného pozadia + diff --git a/Plugins/Flow.Launcher.Plugin.Sys/Languages/sr-Cyrl-RS.xaml b/Plugins/Flow.Launcher.Plugin.Sys/Languages/sr-Cyrl-RS.xaml index 2d2c039c3..58bb224cc 100644 --- a/Plugins/Flow.Launcher.Plugin.Sys/Languages/sr-Cyrl-RS.xaml +++ b/Plugins/Flow.Launcher.Plugin.Sys/Languages/sr-Cyrl-RS.xaml @@ -76,4 +76,9 @@ System Commands Provides System related commands. e.g. shutdown, lock, settings etc. + + This theme supports two (light/dark) modes and Blur Transparent Background + This theme supports two (light/dark) modes + This theme supports Blur Transparent Background + diff --git a/Plugins/Flow.Launcher.Plugin.Sys/Languages/sr.xaml b/Plugins/Flow.Launcher.Plugin.Sys/Languages/sr.xaml index 6490848e6..4ca394f25 100644 --- a/Plugins/Flow.Launcher.Plugin.Sys/Languages/sr.xaml +++ b/Plugins/Flow.Launcher.Plugin.Sys/Languages/sr.xaml @@ -76,4 +76,9 @@ System Commands Provides System related commands. e.g. shutdown, lock, settings etc. + + This theme supports two (light/dark) modes and Blur Transparent Background + This theme supports two (light/dark) modes + This theme supports Blur Transparent Background + diff --git a/Plugins/Flow.Launcher.Plugin.Sys/Languages/tr.xaml b/Plugins/Flow.Launcher.Plugin.Sys/Languages/tr.xaml index b8dcccbe2..49fee5a9f 100644 --- a/Plugins/Flow.Launcher.Plugin.Sys/Languages/tr.xaml +++ b/Plugins/Flow.Launcher.Plugin.Sys/Languages/tr.xaml @@ -76,4 +76,9 @@ Sistem Komutları Sistem ile ilgili komutlara erişim sağlar. ör. shutdown, lock, settings vb. + + Bu tema iki modu (açık/koyu) ve Bulanık Şeffaf Arka Planı destekler + Bu tema iki (açık/koyu) modu destekler + Bu tema Bulanık Şeffaf Arka Planı destekler + diff --git a/Plugins/Flow.Launcher.Plugin.Sys/Languages/uk-UA.xaml b/Plugins/Flow.Launcher.Plugin.Sys/Languages/uk-UA.xaml index dd44f71fd..8b5f3c94b 100644 --- a/Plugins/Flow.Launcher.Plugin.Sys/Languages/uk-UA.xaml +++ b/Plugins/Flow.Launcher.Plugin.Sys/Languages/uk-UA.xaml @@ -76,4 +76,9 @@ Системні команди Надає команди, пов'язані з системою, наприклад, вимкнення, блокування, налаштування тощо. + + This theme supports two (light/dark) modes and Blur Transparent Background + This theme supports two (light/dark) modes + This theme supports Blur Transparent Background + diff --git a/Plugins/Flow.Launcher.Plugin.Sys/Languages/vi.xaml b/Plugins/Flow.Launcher.Plugin.Sys/Languages/vi.xaml index 3f2e03100..ecbcfb66c 100644 --- a/Plugins/Flow.Launcher.Plugin.Sys/Languages/vi.xaml +++ b/Plugins/Flow.Launcher.Plugin.Sys/Languages/vi.xaml @@ -76,4 +76,9 @@ Lệnh hệ thống Cung cấp các lệnh liên quan đến Hệ thống. ví dụ. tắt máy, khóa, cài đặt, v.v. + + This theme supports two (light/dark) modes and Blur Transparent Background + This theme supports two (light/dark) modes + This theme supports Blur Transparent Background + diff --git a/Plugins/Flow.Launcher.Plugin.Sys/Languages/zh-cn.xaml b/Plugins/Flow.Launcher.Plugin.Sys/Languages/zh-cn.xaml index 90666a59b..170bbbd39 100644 --- a/Plugins/Flow.Launcher.Plugin.Sys/Languages/zh-cn.xaml +++ b/Plugins/Flow.Launcher.Plugin.Sys/Languages/zh-cn.xaml @@ -76,4 +76,9 @@ 系统命令 提供操作系统相关的命令,如关机、锁定、设置等。 + + 该主题支持两种(浅色/深色)模式和模糊透明背景 + 该主题支持两种(浅色/深色)模式 + 该主题支持模糊透明背景 + diff --git a/Plugins/Flow.Launcher.Plugin.Sys/Languages/zh-tw.xaml b/Plugins/Flow.Launcher.Plugin.Sys/Languages/zh-tw.xaml index 3ab9c8a44..18ac48fd0 100644 --- a/Plugins/Flow.Launcher.Plugin.Sys/Languages/zh-tw.xaml +++ b/Plugins/Flow.Launcher.Plugin.Sys/Languages/zh-tw.xaml @@ -76,4 +76,9 @@ 系統命令 系統相關的命令。例如,關機,鎖定,設定等 + + This theme supports two (light/dark) modes and Blur Transparent Background + This theme supports two (light/dark) modes + This theme supports Blur Transparent Background + diff --git a/Plugins/Flow.Launcher.Plugin.Sys/Main.cs b/Plugins/Flow.Launcher.Plugin.Sys/Main.cs index 77278a054..57b9749f7 100644 --- a/Plugins/Flow.Launcher.Plugin.Sys/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.Sys/Main.cs @@ -4,6 +4,7 @@ using System.Diagnostics; using System.Globalization; using System.Linq; using System.Runtime.InteropServices; +using System.Threading.Tasks; using System.Windows; using Windows.Win32; using Windows.Win32.Foundation; @@ -42,7 +43,7 @@ namespace Flow.Launcher.Plugin.Sys {"Toggle Game Mode", "flowlauncher_plugin_sys_toggle_game_mode_cmd"}, {"Set Flow Launcher Theme", "flowlauncher_plugin_sys_theme_selector_cmd"} }; - private readonly Dictionary KeywordDescriptionMappings = new(); + private readonly Dictionary KeywordDescriptionMappings = []; // SHTDN_REASON_MAJOR_OTHER indicates a generic shutdown reason that isn't categorized under hardware failure, // software updates, or other predefined reasons. @@ -52,22 +53,21 @@ namespace Flow.Launcher.Plugin.Sys private const string Documentation = "https://flowlauncher.com/docs/#/usage-tips"; - private PluginInitContext _context; + internal static PluginInitContext Context { get; private set; } private Settings _settings; - private ThemeSelector _themeSelector; private SettingsViewModel _viewModel; public Control CreateSettingPanel() { UpdateLocalizedNameDescription(false); - return new SysSettings(_context, _viewModel); + return new SysSettings(_viewModel); } public List Query(Query query) { - if(query.Search.StartsWith(ThemeSelector.Keyword)) + if (query.Search.StartsWith(ThemeSelector.Keyword)) { - return _themeSelector.Query(query); + return ThemeSelector.Query(query); } var commands = Commands(query); @@ -85,9 +85,9 @@ namespace Flow.Launcher.Plugin.Sys } // Match from localized title & localized subtitle & keyword - var titleMatch = _context.API.FuzzySearch(query.Search, c.Title); - var subTitleMatch = _context.API.FuzzySearch(query.Search, c.SubTitle); - var keywordMatch = _context.API.FuzzySearch(query.Search, command.Keyword); + var titleMatch = Context.API.FuzzySearch(query.Search, c.Title); + var subTitleMatch = Context.API.FuzzySearch(query.Search, c.SubTitle); + var keywordMatch = Context.API.FuzzySearch(query.Search, command.Keyword); // Get the largest score from them var score = Math.Max(titleMatch.Score, subTitleMatch.Score); @@ -113,30 +113,29 @@ namespace Flow.Launcher.Plugin.Sys { if (!KeywordTitleMappings.TryGetValue(key, out var translationKey)) { - _context.API.LogError(ClassName, $"Title not found for: {key}"); + Context.API.LogError(ClassName, $"Title not found for: {key}"); return "Title Not Found"; } - return _context.API.GetTranslation(translationKey); + return Context.API.GetTranslation(translationKey); } private string GetDescription(string key) { if (!KeywordDescriptionMappings.TryGetValue(key, out var translationKey)) { - _context.API.LogError(ClassName, $"Description not found for: {key}"); + Context.API.LogError(ClassName, $"Description not found for: {key}"); return "Description Not Found"; } - return _context.API.GetTranslation(translationKey); + return Context.API.GetTranslation(translationKey); } public void Init(PluginInitContext context) { - _context = context; + Context = context; _settings = context.API.LoadSettingJsonStorage(); _viewModel = new SettingsViewModel(_settings); - _themeSelector = new ThemeSelector(context); foreach (string key in KeywordTitleMappings.Keys) { // Remove _cmd in the last of the strings @@ -194,12 +193,12 @@ namespace Flow.Launcher.Plugin.Sys } } - private List Commands(Query query) + private static List Commands(Query query) { var results = new List(); var recycleBinFolder = "shell:RecycleBinFolder"; - results.AddRange(new[] - { + results.AddRange( + [ new Result { Title = "Shutdown", @@ -207,17 +206,20 @@ namespace Flow.Launcher.Plugin.Sys IcoPath = "Images\\shutdown.png", Action = c => { - var result = _context.API.ShowMsgBox( - _context.API.GetTranslation("flowlauncher_plugin_sys_dlgtext_shutdown_computer"), - _context.API.GetTranslation("flowlauncher_plugin_sys_shutdown_computer"), + var result = Context.API.ShowMsgBox( + Localize.flowlauncher_plugin_sys_dlgtext_shutdown_computer(), + Localize.flowlauncher_plugin_sys_shutdown_computer(), MessageBoxButton.YesNo, MessageBoxImage.Warning); - if (result == MessageBoxResult.Yes) + { + // Save settings before shutdown to avoid data loss + Context.API.SaveAppAllSettings(); + if (EnableShutdownPrivilege()) PInvoke.ExitWindowsEx(EXIT_WINDOWS_FLAGS.EWX_SHUTDOWN | EXIT_WINDOWS_FLAGS.EWX_POWEROFF, REASON); else Process.Start("shutdown", "/s /t 0"); - + } return true; } }, @@ -228,17 +230,20 @@ namespace Flow.Launcher.Plugin.Sys IcoPath = "Images\\restart.png", Action = c => { - var result = _context.API.ShowMsgBox( - _context.API.GetTranslation("flowlauncher_plugin_sys_dlgtext_restart_computer"), - _context.API.GetTranslation("flowlauncher_plugin_sys_restart_computer"), + var result = Context.API.ShowMsgBox( + Localize.flowlauncher_plugin_sys_dlgtext_restart_computer(), + Localize.flowlauncher_plugin_sys_restart_computer(), MessageBoxButton.YesNo, MessageBoxImage.Warning); - if (result == MessageBoxResult.Yes) + { + // Save settings before restart to avoid data loss + Context.API.SaveAppAllSettings(); + if (EnableShutdownPrivilege()) PInvoke.ExitWindowsEx(EXIT_WINDOWS_FLAGS.EWX_REBOOT, REASON); else Process.Start("shutdown", "/r /t 0"); - + } return true; } }, @@ -249,17 +254,20 @@ namespace Flow.Launcher.Plugin.Sys IcoPath = "Images\\restart_advanced.png", Action = c => { - var result = _context.API.ShowMsgBox( - _context.API.GetTranslation("flowlauncher_plugin_sys_dlgtext_restart_computer_advanced"), - _context.API.GetTranslation("flowlauncher_plugin_sys_restart_computer"), + var result = Context.API.ShowMsgBox( + Localize.flowlauncher_plugin_sys_dlgtext_restart_computer_advanced(), + Localize.flowlauncher_plugin_sys_restart_computer(), MessageBoxButton.YesNo, MessageBoxImage.Warning); - if (result == MessageBoxResult.Yes) + { + // Save settings before advanced restart to avoid data loss + Context.API.SaveAppAllSettings(); + if (EnableShutdownPrivilege()) PInvoke.ExitWindowsEx(EXIT_WINDOWS_FLAGS.EWX_REBOOT | EXIT_WINDOWS_FLAGS.EWX_BOOTOPTIONS, REASON); else Process.Start("shutdown", "/r /o /t 0"); - + } return true; } }, @@ -270,14 +278,12 @@ namespace Flow.Launcher.Plugin.Sys IcoPath = "Images\\logoff.png", Action = c => { - var result = _context.API.ShowMsgBox( - _context.API.GetTranslation("flowlauncher_plugin_sys_dlgtext_logoff_computer"), - _context.API.GetTranslation("flowlauncher_plugin_sys_log_off"), + var result = Context.API.ShowMsgBox( + Localize.flowlauncher_plugin_sys_dlgtext_logoff_computer(), + Localize.flowlauncher_plugin_sys_log_off(), MessageBoxButton.YesNo, MessageBoxImage.Warning); - if (result == MessageBoxResult.Yes) PInvoke.ExitWindowsEx(EXIT_WINDOWS_FLAGS.EWX_LOGOFF, REASON); - return true; } }, @@ -338,12 +344,11 @@ namespace Flow.Launcher.Plugin.Sys var result = PInvoke.SHEmptyRecycleBin(new(), string.Empty, 0); if (result != HRESULT.S_OK && result != HRESULT.E_UNEXPECTED) { - _context.API.ShowMsgBox( - string.Format(_context.API.GetTranslation("flowlauncher_plugin_sys_dlgtext_empty_recycle_bin_failed"), Environment.NewLine), - _context.API.GetTranslation("flowlauncher_plugin_sys_dlgtitle_error"), + Context.API.ShowMsgBox( + Localize.flowlauncher_plugin_sys_dlgtext_empty_recycle_bin_failed(Environment.NewLine), + Localize.flowlauncher_plugin_sys_dlgtitle_error(), MessageBoxButton.OK, MessageBoxImage.Error); } - return true; } }, @@ -366,7 +371,7 @@ namespace Flow.Launcher.Plugin.Sys Glyph = new GlyphInfo (FontFamily:"/Resources/#Segoe Fluent Icons", Glyph:"\xe89f"), Action = c => { - _context.API.HideMainWindow(); + Context.API.HideMainWindow(); Application.Current.MainWindow.Close(); return true; } @@ -378,9 +383,9 @@ namespace Flow.Launcher.Plugin.Sys IcoPath = "Images\\app.png", Action = c => { - _context.API.SaveAppAllSettings(); - _context.API.ShowMsg(_context.API.GetTranslation("flowlauncher_plugin_sys_dlgtitle_success"), - _context.API.GetTranslation("flowlauncher_plugin_sys_dlgtext_all_settings_saved")); + Context.API.SaveAppAllSettings(); + Context.API.ShowMsg(Localize.flowlauncher_plugin_sys_dlgtitle_success(), + Localize.flowlauncher_plugin_sys_dlgtext_all_settings_saved()); return true; } }, @@ -391,7 +396,7 @@ namespace Flow.Launcher.Plugin.Sys IcoPath = "Images\\app.png", Action = c => { - _context.API.RestartApp(); + Context.API.RestartApp(); return false; } }, @@ -403,8 +408,8 @@ namespace Flow.Launcher.Plugin.Sys Action = c => { // Hide the window first then open setting dialog because main window can be topmost window which will still display on top of the setting dialog for a while - _context.API.HideMainWindow(); - _context.API.OpenSettingDialog(); + Context.API.HideMainWindow(); + Context.API.OpenSettingDialog(); return true; } }, @@ -416,15 +421,12 @@ namespace Flow.Launcher.Plugin.Sys Action = c => { // Hide the window first then show msg after done because sometimes the reload could take a while, so not to make user think it's frozen. - _context.API.HideMainWindow(); - - _ = _context.API.ReloadAllPluginData().ContinueWith(_ => - _context.API.ShowMsg( - _context.API.GetTranslation("flowlauncher_plugin_sys_dlgtitle_success"), - _context.API.GetTranslation( - "flowlauncher_plugin_sys_dlgtext_all_applicableplugins_reloaded")), - System.Threading.Tasks.TaskScheduler.Current); - + Context.API.HideMainWindow(); + _ = Context.API.ReloadAllPluginData().ContinueWith(_ => + Context.API.ShowMsg( + Localize.flowlauncher_plugin_sys_dlgtitle_success(), + Localize.flowlauncher_plugin_sys_dlgtext_all_applicableplugins_reloaded()), + TaskScheduler.Current); return true; } }, @@ -435,8 +437,8 @@ namespace Flow.Launcher.Plugin.Sys IcoPath = "Images\\checkupdate.png", Action = c => { - _context.API.HideMainWindow(); - _context.API.CheckForNewUpdate(); + Context.API.HideMainWindow(); + Context.API.CheckForNewUpdate(); return true; } }, @@ -445,11 +447,11 @@ namespace Flow.Launcher.Plugin.Sys Glyph = new GlyphInfo (FontFamily:"/Resources/#Segoe Fluent Icons", Glyph:"\xf12b"), Title = "Open Log Location", IcoPath = "Images\\app.png", - CopyText = _context.API.GetLogDirectory(), - AutoCompleteText = _context.API.GetLogDirectory(), + CopyText = Context.API.GetLogDirectory(), + AutoCompleteText = Context.API.GetLogDirectory(), Action = c => { - _context.API.OpenDirectory(_context.API.GetLogDirectory()); + Context.API.OpenDirectory(Context.API.GetLogDirectory()); return true; } }, @@ -462,7 +464,7 @@ namespace Flow.Launcher.Plugin.Sys AutoCompleteText = Documentation, Action = c => { - _context.API.OpenUrl(Documentation); + Context.API.OpenUrl(Documentation); return true; } }, @@ -471,11 +473,11 @@ namespace Flow.Launcher.Plugin.Sys Title = "Flow Launcher UserData Folder", Glyph = new GlyphInfo (FontFamily:"/Resources/#Segoe Fluent Icons", Glyph:"\xf12b"), IcoPath = "Images\\app.png", - CopyText = _context.API.GetDataDirectory(), - AutoCompleteText = _context.API.GetDataDirectory(), + CopyText = Context.API.GetDataDirectory(), + AutoCompleteText = Context.API.GetDataDirectory(), Action = c => { - _context.API.OpenDirectory(_context.API.GetDataDirectory()); + Context.API.OpenDirectory(Context.API.GetDataDirectory()); return true; } }, @@ -486,7 +488,7 @@ namespace Flow.Launcher.Plugin.Sys Glyph = new GlyphInfo (FontFamily:"/Resources/#Segoe Fluent Icons", Glyph:"\ue7fc"), Action = c => { - _context.API.ToggleGameMode(); + Context.API.ToggleGameMode(); return true; } }, @@ -499,29 +501,28 @@ namespace Flow.Launcher.Plugin.Sys { if (string.IsNullOrEmpty(query.ActionKeyword)) { - _context.API.ChangeQuery($"{ThemeSelector.Keyword}{Plugin.Query.ActionKeywordSeparator}"); + Context.API.ChangeQuery($"{ThemeSelector.Keyword}{Plugin.Query.ActionKeywordSeparator}"); } else { - _context.API.ChangeQuery($"{query.ActionKeyword}{Plugin.Query.ActionKeywordSeparator}{ThemeSelector.Keyword}{Plugin.Query.ActionKeywordSeparator}"); - + Context.API.ChangeQuery($"{query.ActionKeyword}{Plugin.Query.ActionKeywordSeparator}{ThemeSelector.Keyword}{Plugin.Query.ActionKeywordSeparator}"); } return false; } } - }); + ]); return results; } public string GetTranslatedPluginTitle() { - return _context.API.GetTranslation("flowlauncher_plugin_sys_plugin_name"); + return Localize.flowlauncher_plugin_sys_plugin_name(); } public string GetTranslatedPluginDescription() { - return _context.API.GetTranslation("flowlauncher_plugin_sys_plugin_description"); + return Localize.flowlauncher_plugin_sys_plugin_description(); } public void OnCultureInfoChanged(CultureInfo _) diff --git a/Plugins/Flow.Launcher.Plugin.Sys/Settings.cs b/Plugins/Flow.Launcher.Plugin.Sys/Settings.cs index f39e6d65f..96a545e74 100644 --- a/Plugins/Flow.Launcher.Plugin.Sys/Settings.cs +++ b/Plugins/Flow.Launcher.Plugin.Sys/Settings.cs @@ -13,8 +13,8 @@ public class Settings : BaseModel } } - public ObservableCollection Commands { get; set; } = new ObservableCollection - { + public ObservableCollection Commands { get; set; } = + [ new() { Key = "Shutdown", @@ -120,7 +120,7 @@ public class Settings : BaseModel Key = "Set Flow Launcher Theme", Keyword = "Set Flow Launcher Theme" } - }; + ]; [JsonIgnore] public Command SelectedCommand { get; set; } diff --git a/Plugins/Flow.Launcher.Plugin.Sys/SettingsViewModel.cs b/Plugins/Flow.Launcher.Plugin.Sys/SettingsViewModel.cs index 0755dffa9..bda8c6c04 100644 --- a/Plugins/Flow.Launcher.Plugin.Sys/SettingsViewModel.cs +++ b/Plugins/Flow.Launcher.Plugin.Sys/SettingsViewModel.cs @@ -1,12 +1,7 @@ namespace Flow.Launcher.Plugin.Sys { - public class SettingsViewModel + public class SettingsViewModel(Settings settings) { - public SettingsViewModel(Settings settings) - { - Settings = settings; - } - - public Settings Settings { get; } + public Settings Settings { get; } = settings; } } diff --git a/Plugins/Flow.Launcher.Plugin.Sys/SysSettings.xaml.cs b/Plugins/Flow.Launcher.Plugin.Sys/SysSettings.xaml.cs index 1a8621eeb..9906db46d 100644 --- a/Plugins/Flow.Launcher.Plugin.Sys/SysSettings.xaml.cs +++ b/Plugins/Flow.Launcher.Plugin.Sys/SysSettings.xaml.cs @@ -1,17 +1,16 @@ using System.Windows; using System.Windows.Controls; +using System.Windows.Input; namespace Flow.Launcher.Plugin.Sys { public partial class SysSettings : UserControl { - private readonly PluginInitContext _context; private readonly Settings _settings; - public SysSettings(PluginInitContext context, SettingsViewModel viewModel) + public SysSettings(SettingsViewModel viewModel) { InitializeComponent(); - _context = context; _settings = viewModel.Settings; DataContext = viewModel; } @@ -37,15 +36,15 @@ namespace Flow.Launcher.Plugin.Sys public void OnEditCommandKeywordClick(object sender, RoutedEventArgs e) { - var commandKeyword = new CommandKeywordSettingWindow(_context, _settings.SelectedCommand); + var commandKeyword = new CommandKeywordSettingWindow(_settings.SelectedCommand); commandKeyword.ShowDialog(); } - private void MouseDoubleClickItem(object sender, System.Windows.Input.MouseButtonEventArgs e) + private void MouseDoubleClickItem(object sender, MouseButtonEventArgs e) { if (((FrameworkElement)e.OriginalSource).DataContext is Command && _settings.SelectedCommand != null) { - var commandKeyword = new CommandKeywordSettingWindow(_context, _settings.SelectedCommand); + var commandKeyword = new CommandKeywordSettingWindow(_settings.SelectedCommand); commandKeyword.ShowDialog(); } } diff --git a/Plugins/Flow.Launcher.Plugin.Sys/ThemeSelector.cs b/Plugins/Flow.Launcher.Plugin.Sys/ThemeSelector.cs index f8aeaeafd..50b1063ef 100644 --- a/Plugins/Flow.Launcher.Plugin.Sys/ThemeSelector.cs +++ b/Plugins/Flow.Launcher.Plugin.Sys/ThemeSelector.cs @@ -4,40 +4,30 @@ using Flow.Launcher.Plugin.SharedModels; namespace Flow.Launcher.Plugin.Sys { - public class ThemeSelector + public static class ThemeSelector { public const string Keyword = "fltheme"; - private readonly PluginInitContext _context; - - public ThemeSelector(PluginInitContext context) + public static List Query(Query query) { - _context = context; - } - - public List Query(Query query) - { - var themes = _context.API.GetAvailableThemes(); - var selectedTheme = _context.API.GetCurrentTheme(); + var themes = Main.Context.API.GetAvailableThemes(); + var selectedTheme = Main.Context.API.GetCurrentTheme(); var search = query.SecondToEndSearch; if (string.IsNullOrWhiteSpace(search)) { - return themes.Select(x => CreateThemeResult(x, selectedTheme)) - .OrderBy(x => x.Title) - .ToList(); + return [.. themes.Select(x => CreateThemeResult(x, selectedTheme)).OrderBy(x => x.Title)]; } - return themes.Select(theme => (theme, matchResult: _context.API.FuzzySearch(search, theme.Name))) - .Where(x => x.matchResult.IsSearchPrecisionScoreMet()) - .Select(x => CreateThemeResult(x.theme, selectedTheme, x.matchResult.Score, x.matchResult.MatchData)) - .OrderBy(x => x.Title) - .ToList(); + return [.. themes.Select(theme => (theme, matchResult: Main.Context.API.FuzzySearch(search, theme.Name))) + .Where(x => x.matchResult.IsSearchPrecisionScoreMet()) + .Select(x => CreateThemeResult(x.theme, selectedTheme, x.matchResult.Score, x.matchResult.MatchData)) + .OrderBy(x => x.Title)]; } - private Result CreateThemeResult(ThemeData theme, ThemeData selectedTheme) => CreateThemeResult(theme, selectedTheme, 0, null); + private static Result CreateThemeResult(ThemeData theme, ThemeData selectedTheme) => CreateThemeResult(theme, selectedTheme, 0, null); - private Result CreateThemeResult(ThemeData theme, ThemeData selectedTheme, int score, IList highlightData) + private static Result CreateThemeResult(ThemeData theme, ThemeData selectedTheme, int score, IList highlightData) { string title; if (theme == selectedTheme) @@ -53,17 +43,28 @@ namespace Flow.Launcher.Plugin.Sys score = 1000; } - string description = string.Empty; + string description; if (theme.IsDark == true) { - description += _context.API.GetTranslation("TypeIsDarkToolTip"); + if (theme.HasBlur == true) + { + description = Localize.flowlauncher_plugin_sys_type_isdark_hasblur(); + } + else + { + description = Localize.flowlauncher_plugin_sys_type_isdark(); + } } - - if (theme.HasBlur == true) + else { - if (!string.IsNullOrEmpty(description)) - description += " "; - description += _context.API.GetTranslation("TypeHasBlurToolTip"); + if (theme.HasBlur == true) + { + description = Localize.flowlauncher_plugin_sys_type_hasblur(); + } + else + { + description = string.Empty; + } } return new Result @@ -76,9 +77,9 @@ namespace Flow.Launcher.Plugin.Sys Score = score, Action = c => { - if (_context.API.SetCurrentTheme(theme)) + if (Main.Context.API.SetCurrentTheme(theme)) { - _context.API.ReQuery(); + Main.Context.API.ReQuery(); } return false; } diff --git a/Plugins/Flow.Launcher.Plugin.Url/Flow.Launcher.Plugin.Url.csproj b/Plugins/Flow.Launcher.Plugin.Url/Flow.Launcher.Plugin.Url.csproj index fdfe03224..091248cfd 100644 --- a/Plugins/Flow.Launcher.Plugin.Url/Flow.Launcher.Plugin.Url.csproj +++ b/Plugins/Flow.Launcher.Plugin.Url/Flow.Launcher.Plugin.Url.csproj @@ -33,6 +33,7 @@ prompt 4 false + $(NoWarn);FLSG0007 @@ -56,4 +57,8 @@ + + + + diff --git a/Plugins/Flow.Launcher.Plugin.Url/Languages/ar.xaml b/Plugins/Flow.Launcher.Plugin.Url/Languages/ar.xaml index a6f6f1296..dbe3f9ac0 100644 --- a/Plugins/Flow.Launcher.Plugin.Url/Languages/ar.xaml +++ b/Plugins/Flow.Launcher.Plugin.Url/Languages/ar.xaml @@ -1,17 +1,22 @@  - فتح البحث في: - نافذة جديدة - علامة تبويب جديد - فتح الرابط:{0} لا يمكن فتح الرابط:{0} عنوان الرابط فتح عنوان URL المكتوب من Flow Launcher - الرجاء تعيين مسار المتصفح الخاص بك: اختر تطبيق(*.exe)|*.exe|جميع الملفات|*.* + + Use custom instead of Flow's default web browser + Browser path + + علامة تبويب جديدة + نافذة جديدة + + Private mode + + Prefer https over http diff --git a/Plugins/Flow.Launcher.Plugin.Url/Languages/cs.xaml b/Plugins/Flow.Launcher.Plugin.Url/Languages/cs.xaml index 92974fd6d..c27f73fc7 100644 --- a/Plugins/Flow.Launcher.Plugin.Url/Languages/cs.xaml +++ b/Plugins/Flow.Launcher.Plugin.Url/Languages/cs.xaml @@ -1,17 +1,22 @@  - Otevřít vyhledávání v: - Nové okno - Nová karta - Otevřít URL:{0} Nelze otevřít URL:{0} URL Otevření zadané adresy URL z nástroje Flow Launcher - Nastavte cestu k prohlížeči: Vybrat Aplikace(*.exe)|*.exe|Všechny soubory|*. * + + Use custom instead of Flow's default web browser + Browser path + + Nová záložka + Nové okno + + Private mode + + Prefer https over http diff --git a/Plugins/Flow.Launcher.Plugin.Url/Languages/da.xaml b/Plugins/Flow.Launcher.Plugin.Url/Languages/da.xaml index 418731021..7c71f82a4 100644 --- a/Plugins/Flow.Launcher.Plugin.Url/Languages/da.xaml +++ b/Plugins/Flow.Launcher.Plugin.Url/Languages/da.xaml @@ -1,17 +1,22 @@  - Open search in: - New Window - New Tab - Open url:{0} Can't open url:{0} URL Open the typed URL from Flow Launcher - Please set your browser path: Choose Application(*.exe)|*.exe|All files|*.* + + Use custom instead of Flow's default web browser + Browser path + + New tab + New window + + Private mode + + Prefer https over http diff --git a/Plugins/Flow.Launcher.Plugin.Url/Languages/de.xaml b/Plugins/Flow.Launcher.Plugin.Url/Languages/de.xaml index ee13754d5..a352ddaee 100644 --- a/Plugins/Flow.Launcher.Plugin.Url/Languages/de.xaml +++ b/Plugins/Flow.Launcher.Plugin.Url/Languages/de.xaml @@ -1,17 +1,22 @@  - Suche öffnen in: - Neues Fenster - Neuer Tab - URL öffnen: {0} URL kann nicht geöffnet werden: {0} URL Öffnen Sie die eingetippte URL in Flow Launcher - Bitte legen Sie Ihren Browser-Pfad fest: Wählen Anwendung (*.exe)|*.exe|Alle Dateien|*.* + + Use custom instead of Flow's default web browser + Browser path + + Neuer Tab + Neues Fenster + + Private mode + + Prefer https over http diff --git a/Plugins/Flow.Launcher.Plugin.Url/Languages/es-419.xaml b/Plugins/Flow.Launcher.Plugin.Url/Languages/es-419.xaml index 66a1710ea..2d4634887 100644 --- a/Plugins/Flow.Launcher.Plugin.Url/Languages/es-419.xaml +++ b/Plugins/Flow.Launcher.Plugin.Url/Languages/es-419.xaml @@ -1,17 +1,22 @@  - Abrir búsqueda en: - Nueva Ventana - Nueva Pestaña - Abrir url:{0} Can't open url:{0} URL Abre la URL escrita desde Flow Launcher - Por favor, establezca la ruta de su navegador: Elija Aplicación(*.exe)|*.exe|Todos los archivos|*.* + + Use custom instead of Flow's default web browser + Browser path + + New tab + New window + + Private mode + + Prefer https over http diff --git a/Plugins/Flow.Launcher.Plugin.Url/Languages/es.xaml b/Plugins/Flow.Launcher.Plugin.Url/Languages/es.xaml index fe83fa6f6..5d402f293 100644 --- a/Plugins/Flow.Launcher.Plugin.Url/Languages/es.xaml +++ b/Plugins/Flow.Launcher.Plugin.Url/Languages/es.xaml @@ -1,17 +1,22 @@  - Abrir búsqueda en: - Nueva ventana - Nueva pestaña - Abrir url:{0} No se puede abrir la url:{0} URL Abre la URL escrita desde Flow Launcher - Por favor, establezca la ruta del navegador: Elegir Aplicación(*.exe)|*.exe|Todos los archivos|*.* + + Use custom instead of Flow's default web browser + Browser path + + Nueva pestaña + Nueva ventana + + Private mode + + Prefer https over http diff --git a/Plugins/Flow.Launcher.Plugin.Url/Languages/fr.xaml b/Plugins/Flow.Launcher.Plugin.Url/Languages/fr.xaml index b9f9742bb..f77b1256f 100644 --- a/Plugins/Flow.Launcher.Plugin.Url/Languages/fr.xaml +++ b/Plugins/Flow.Launcher.Plugin.Url/Languages/fr.xaml @@ -1,17 +1,22 @@  - Ouvrir la recherche dans : - Nouvelle fenêtre - Nouvel onglet - Ouvrir l'url : {0} Impossible d'ouvrir l'url : {0} URL Ouvrir l'URL saisie depuis Flow Launcher - Veuillez définir le chemin d'accès de votre navigateur : Choisir Application(*.exe)|*.exe|Tous les fichiers|*.* + + Utiliser un navigateur personnalisé au lieu du navigateur par défaut de Flow + Chemin du navigateur + + Nouvel onglet + Nouvelle fenêtre + + Mode privé + + Préférer HTTPS à HTTP diff --git a/Plugins/Flow.Launcher.Plugin.Url/Languages/he.xaml b/Plugins/Flow.Launcher.Plugin.Url/Languages/he.xaml index 5f5aa5526..33f9e80a0 100644 --- a/Plugins/Flow.Launcher.Plugin.Url/Languages/he.xaml +++ b/Plugins/Flow.Launcher.Plugin.Url/Languages/he.xaml @@ -1,17 +1,22 @@  - פתח חיפוש ב: - חלון חד - לשונית חדשה - פתח כתובת URL: {0} לא ניתן לפתוח כתובת URL: {0} כתובת URL פתח את כתובת ה-URL שהוזנה מתוך Flow Launcher - הגדר את נתיב הדפדפן שלך: בח יישומים (*.exe)|*.exe|כל הקבצים|*.* + + Use custom instead of Flow's default web browser + Browser path + + כרטיסייה חדשה + חלון חד + + Private mode + + Prefer https over http diff --git a/Plugins/Flow.Launcher.Plugin.Url/Languages/it.xaml b/Plugins/Flow.Launcher.Plugin.Url/Languages/it.xaml index 344c6fc1e..b9f3d463a 100644 --- a/Plugins/Flow.Launcher.Plugin.Url/Languages/it.xaml +++ b/Plugins/Flow.Launcher.Plugin.Url/Languages/it.xaml @@ -1,17 +1,22 @@  - Apri ricerca in: - Nuova Finestra - Nuova Scheda - Apri url:{0} Impossibile aprire l'url:{0} URL Apri l'URL digitato da Flow Launcher - Imposta il percorso del tuo browser: Scegli Applicazione(*.exe)|*.exe|Tutti i file|*.* + + Use custom instead of Flow's default web browser + Browser path + + Nuova scheda + Nuova finestra + + Private mode + + Prefer https over http diff --git a/Plugins/Flow.Launcher.Plugin.Url/Languages/ja.xaml b/Plugins/Flow.Launcher.Plugin.Url/Languages/ja.xaml index 4275713a1..f643a1081 100644 --- a/Plugins/Flow.Launcher.Plugin.Url/Languages/ja.xaml +++ b/Plugins/Flow.Launcher.Plugin.Url/Languages/ja.xaml @@ -1,17 +1,22 @@  - 検索を開く: - 新しいウィンドウ - 新しいタブ - 次のURLを開く:{0} 次のURLを開くことができません:{0} URL 入力したURLをFlow Launcherから開くプラグインです。 - ブラウザのパスを設定してください: 選択 Application(*.exe)|*.exe|All files|*.* + + Use custom instead of Flow's default web browser + Browser path + + New tab + New window + + Private mode + + Prefer https over http diff --git a/Plugins/Flow.Launcher.Plugin.Url/Languages/ko.xaml b/Plugins/Flow.Launcher.Plugin.Url/Languages/ko.xaml index 489a6d4b7..f37cce508 100644 --- a/Plugins/Flow.Launcher.Plugin.Url/Languages/ko.xaml +++ b/Plugins/Flow.Launcher.Plugin.Url/Languages/ko.xaml @@ -1,17 +1,22 @@  - Open search in: - New Window - New Tab - Open url:{0} Can't open url:{0} URL Flow Launcher에 입력한 URL 열기 - Please set your browser path: Choose Application(*.exe)|*.exe|All files|*.* + + Use custom instead of Flow's default web browser + Browser path + + 새 탭 + 새 창 + + Private mode + + Prefer https over http diff --git a/Plugins/Flow.Launcher.Plugin.Url/Languages/nb.xaml b/Plugins/Flow.Launcher.Plugin.Url/Languages/nb.xaml index 1177c318c..419b87858 100644 --- a/Plugins/Flow.Launcher.Plugin.Url/Languages/nb.xaml +++ b/Plugins/Flow.Launcher.Plugin.Url/Languages/nb.xaml @@ -1,17 +1,22 @@  - Åpne søk i: - Nytt vindu - Ny fane - Åpne nettadresse:{0} Kan ikke åpne nettadresse:{0} Nettadresse Åpne den innskrevne nettadressen fra Flow Launcher - Vennligst angi nettleserens sti: Velg Applikasjon(*.exe)|*.exe|Alle filer|*.* + + Use custom instead of Flow's default web browser + Browser path + + Ny fane + Nytt vindu + + Private mode + + Prefer https over http diff --git a/Plugins/Flow.Launcher.Plugin.Url/Languages/nl.xaml b/Plugins/Flow.Launcher.Plugin.Url/Languages/nl.xaml index 418731021..7c71f82a4 100644 --- a/Plugins/Flow.Launcher.Plugin.Url/Languages/nl.xaml +++ b/Plugins/Flow.Launcher.Plugin.Url/Languages/nl.xaml @@ -1,17 +1,22 @@  - Open search in: - New Window - New Tab - Open url:{0} Can't open url:{0} URL Open the typed URL from Flow Launcher - Please set your browser path: Choose Application(*.exe)|*.exe|All files|*.* + + Use custom instead of Flow's default web browser + Browser path + + New tab + New window + + Private mode + + Prefer https over http diff --git a/Plugins/Flow.Launcher.Plugin.Url/Languages/pl.xaml b/Plugins/Flow.Launcher.Plugin.Url/Languages/pl.xaml index bf54c6fe6..812200849 100644 --- a/Plugins/Flow.Launcher.Plugin.Url/Languages/pl.xaml +++ b/Plugins/Flow.Launcher.Plugin.Url/Languages/pl.xaml @@ -1,17 +1,22 @@  - Otwórz wyszukiwanie w: - Nowe okno - Nowa zakładka - Otwórz adres URL: {0} Nie udało się otworzyć adresu: {0} URL Otwórz wpisany adres URL z poziomu Flow Launchera - Ustaw ścieżkę przeglądarki: Wybierz Aplikacja(*.exe)|*.exe|Wszystkie pliki|*.* + + Use custom instead of Flow's default web browser + Browser path + + Nowa karta + Nowe okno + + Private mode + + Prefer https over http diff --git a/Plugins/Flow.Launcher.Plugin.Url/Languages/pt-br.xaml b/Plugins/Flow.Launcher.Plugin.Url/Languages/pt-br.xaml index b9b080852..58644999b 100644 --- a/Plugins/Flow.Launcher.Plugin.Url/Languages/pt-br.xaml +++ b/Plugins/Flow.Launcher.Plugin.Url/Languages/pt-br.xaml @@ -1,17 +1,22 @@  - Open search in: - Nova Janela - Nova Aba - Abrir link:{0} Não é possível abrir o link:{0} URL Open the typed URL from Flow Launcher - Please set your browser path: Escolha Application(*.exe)|*.exe|All files|*.* + + Use custom instead of Flow's default web browser + Browser path + + Nova aba + Nova janela + + Private mode + + Prefer https over http diff --git a/Plugins/Flow.Launcher.Plugin.Url/Languages/pt-pt.xaml b/Plugins/Flow.Launcher.Plugin.Url/Languages/pt-pt.xaml index 38d757721..785b848ba 100644 --- a/Plugins/Flow.Launcher.Plugin.Url/Languages/pt-pt.xaml +++ b/Plugins/Flow.Launcher.Plugin.Url/Languages/pt-pt.xaml @@ -1,17 +1,22 @@  - Abrir pesquisa em: - Nova janela - Novo separador - Abrir URL:{0} Não foi possível abrir o URL:{0} URL Abrir o URL no Flow Launcher - Defina o caminho do navegador: Escolher Aplicação(*.exe)|*.exe|Todos os ficheiros|*.* + + Utilizar navegador personalizado + Caminho do navegador + + Novo separador + Nova janela + + Modo privado + + Preferir HTTPS em vez de HTTP diff --git a/Plugins/Flow.Launcher.Plugin.Url/Languages/ru.xaml b/Plugins/Flow.Launcher.Plugin.Url/Languages/ru.xaml index 15c1eeadb..2c3026a65 100644 --- a/Plugins/Flow.Launcher.Plugin.Url/Languages/ru.xaml +++ b/Plugins/Flow.Launcher.Plugin.Url/Languages/ru.xaml @@ -1,17 +1,22 @@  - Open search in: - Новое окно - Новая вкладка - Open url:{0} Can't open url:{0} URL Open the typed URL from Flow Launcher - Please set your browser path: Выберите Application(*.exe)|*.exe|All files|*.* + + Use custom instead of Flow's default web browser + Browser path + + Новая вкладка + Новое окно + + Private mode + + Prefer https over http diff --git a/Plugins/Flow.Launcher.Plugin.Url/Languages/sk.xaml b/Plugins/Flow.Launcher.Plugin.Url/Languages/sk.xaml index b2f2a018d..11764df1b 100644 --- a/Plugins/Flow.Launcher.Plugin.Url/Languages/sk.xaml +++ b/Plugins/Flow.Launcher.Plugin.Url/Languages/sk.xaml @@ -1,17 +1,22 @@  - Otvoriť vyhľadávanie v: - Nové okno - Nová karta - Otvoriť URL:{0} Adresa URL sa nedá otvoriť:{0} Adresa URL Otvoriť zadanú adresu URL z Flow Launchera - Zadajte cestu k prehliadaču: Prehliadať Aplikácie (*.exe)|*.exe|Všetky súbory|*.* + + Použiť vlastný prehliadač namiesto predvoleného webového prehliadača + Cesta k prehliadaču + + Nová karta + Nové okno + + Privátny režim + + Uprednostniť https pred http diff --git a/Plugins/Flow.Launcher.Plugin.Url/Languages/sr-Cyrl-RS.xaml b/Plugins/Flow.Launcher.Plugin.Url/Languages/sr-Cyrl-RS.xaml index 418731021..7c71f82a4 100644 --- a/Plugins/Flow.Launcher.Plugin.Url/Languages/sr-Cyrl-RS.xaml +++ b/Plugins/Flow.Launcher.Plugin.Url/Languages/sr-Cyrl-RS.xaml @@ -1,17 +1,22 @@  - Open search in: - New Window - New Tab - Open url:{0} Can't open url:{0} URL Open the typed URL from Flow Launcher - Please set your browser path: Choose Application(*.exe)|*.exe|All files|*.* + + Use custom instead of Flow's default web browser + Browser path + + New tab + New window + + Private mode + + Prefer https over http diff --git a/Plugins/Flow.Launcher.Plugin.Url/Languages/sr.xaml b/Plugins/Flow.Launcher.Plugin.Url/Languages/sr.xaml index 418731021..7c71f82a4 100644 --- a/Plugins/Flow.Launcher.Plugin.Url/Languages/sr.xaml +++ b/Plugins/Flow.Launcher.Plugin.Url/Languages/sr.xaml @@ -1,17 +1,22 @@  - Open search in: - New Window - New Tab - Open url:{0} Can't open url:{0} URL Open the typed URL from Flow Launcher - Please set your browser path: Choose Application(*.exe)|*.exe|All files|*.* + + Use custom instead of Flow's default web browser + Browser path + + New tab + New window + + Private mode + + Prefer https over http diff --git a/Plugins/Flow.Launcher.Plugin.Url/Languages/tr.xaml b/Plugins/Flow.Launcher.Plugin.Url/Languages/tr.xaml index fc76ee12e..2ce323d08 100644 --- a/Plugins/Flow.Launcher.Plugin.Url/Languages/tr.xaml +++ b/Plugins/Flow.Launcher.Plugin.Url/Languages/tr.xaml @@ -1,17 +1,22 @@  - Aramayı şurada aç: - Yeni Pencere - Yeni Sekme - URL'yi Aç: {0} URL Açılamıyor: {0} URL Flow Launcher'a yazılan URL'leri açar - Tarayıcınızın konumunu ayarlayın: Seç Programlar (*.exe)|*.exe|Tüm Dosyalar|*.* + + Use custom instead of Flow's default web browser + Browser path + + Yeni sekme + Yeni pencere + + Private mode + + Prefer https over http diff --git a/Plugins/Flow.Launcher.Plugin.Url/Languages/uk-UA.xaml b/Plugins/Flow.Launcher.Plugin.Url/Languages/uk-UA.xaml index 45f29423a..f7ccd7cc1 100644 --- a/Plugins/Flow.Launcher.Plugin.Url/Languages/uk-UA.xaml +++ b/Plugins/Flow.Launcher.Plugin.Url/Languages/uk-UA.xaml @@ -1,17 +1,22 @@  - Запустити пошук: - Нове вікно - Нова вкладка - Відкрити URL:{0} Не вдається відкрити URL:{0} URL Відкрити набрану URL-адресу з Flow Launcher - Будь ласка, встановіть шлях до вашого браузера: Обрати Application(*.exe)|*.exe|Усі файли|*.* + + Use custom instead of Flow's default web browser + Browser path + + Нова вкладка + Нове вікно + + Private mode + + Prefer https over http diff --git a/Plugins/Flow.Launcher.Plugin.Url/Languages/vi.xaml b/Plugins/Flow.Launcher.Plugin.Url/Languages/vi.xaml index 41f87fe19..133f59de6 100644 --- a/Plugins/Flow.Launcher.Plugin.Url/Languages/vi.xaml +++ b/Plugins/Flow.Launcher.Plugin.Url/Languages/vi.xaml @@ -1,17 +1,22 @@  - Mở tìm kiếm - Cửa sổ mới - Tab mới - Mở url:{0} Không thể mở url:{0} Địa chỉ URL Mở URL đã nhập từ Flow Launcher - Vui lòng đặt đường dẫn trình duyệt của bạn: Chọn Ứng dụng(*.exe)|*.exe|Tất cả các tệp|*.* + + Use custom instead of Flow's default web browser + Browser path + + Thêm Tab mới + Cửa sổ mới + + Private mode + + Prefer https over http diff --git a/Plugins/Flow.Launcher.Plugin.Url/Languages/zh-cn.xaml b/Plugins/Flow.Launcher.Plugin.Url/Languages/zh-cn.xaml index 183d81bf1..cb46d4e39 100644 --- a/Plugins/Flow.Launcher.Plugin.Url/Languages/zh-cn.xaml +++ b/Plugins/Flow.Launcher.Plugin.Url/Languages/zh-cn.xaml @@ -1,17 +1,22 @@  - 在以下位置打开 - 新窗口 - 新标签 - 打开链接:{0} 无法打开链接:{0} 打开链接 从 Flow Launcher 打开链接 - 请设置你的浏览器路径: 选择 程序文件(*.exe)|*.exe|所有文件|*.* + + 使用自定义而不是Flow的默认网页浏览器 + 浏览器路径 + + 新标签 + 新窗口 + + 隐私模式 + + 优先使用 https 而不是 http diff --git a/Plugins/Flow.Launcher.Plugin.Url/Languages/zh-tw.xaml b/Plugins/Flow.Launcher.Plugin.Url/Languages/zh-tw.xaml index 3e5fc838c..af0a3b175 100644 --- a/Plugins/Flow.Launcher.Plugin.Url/Languages/zh-tw.xaml +++ b/Plugins/Flow.Launcher.Plugin.Url/Languages/zh-tw.xaml @@ -1,17 +1,22 @@  - Open search in: - 新增視窗 - 新索引標籤 - 開啟連結:{0} 無法開啟連結:{0} 網址 從 Flow Launcher 開啟連結 - 請選擇你的瀏覽器位置: 選擇 應用程式(*.exe)|*.exe|檔案|*.* + + Use custom instead of Flow's default web browser + Browser path + + 新增分頁 + 新增視窗 + + Private mode + + Prefer https over http diff --git a/Plugins/Flow.Launcher.Plugin.Url/Main.cs b/Plugins/Flow.Launcher.Plugin.Url/Main.cs index 9fa52c8da..db7cecbde 100644 --- a/Plugins/Flow.Launcher.Plugin.Url/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.Url/Main.cs @@ -40,7 +40,7 @@ namespace Flow.Launcher.Plugin.Url "(?:/\\S*)?" + "$"; Regex reg = new Regex(urlPattern, RegexOptions.Compiled | RegexOptions.IgnoreCase); - private PluginInitContext context; + internal static PluginInitContext Context { get; private set; } private Settings _settings; public List Query(Query query) @@ -53,7 +53,7 @@ namespace Flow.Launcher.Plugin.Url new Result { Title = raw, - SubTitle = string.Format(context.API.GetTranslation("flowlauncher_plugin_url_open_url"),raw), + SubTitle = Localize.flowlauncher_plugin_url_open_url(raw), IcoPath = "Images/url.png", Score = 8, Action = _ => @@ -64,13 +64,13 @@ namespace Flow.Launcher.Plugin.Url } try { - context.API.OpenUrl(raw); + Context.API.OpenUrl(raw); return true; } catch(Exception) { - context.API.ShowMsgError(string.Format(context.API.GetTranslation("flowlauncher_plugin_url_cannot_open_url"), raw)); + Context.API.ShowMsgError(Localize.flowlauncher_plugin_url_cannot_open_url(raw)); return false; } } @@ -99,19 +99,19 @@ namespace Flow.Launcher.Plugin.Url public void Init(PluginInitContext context) { - this.context = context; + Context = context; _settings = context.API.LoadSettingJsonStorage(); } public string GetTranslatedPluginTitle() { - return context.API.GetTranslation("flowlauncher_plugin_url_plugin_name"); + return Localize.flowlauncher_plugin_url_plugin_name(); } public string GetTranslatedPluginDescription() { - return context.API.GetTranslation("flowlauncher_plugin_url_plugin_description"); + return Localize.flowlauncher_plugin_url_plugin_description(); } } } diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/ar.xaml b/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/ar.xaml index edb44f8f4..dda561f00 100644 --- a/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/ar.xaml +++ b/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/ar.xaml @@ -45,6 +45,7 @@ يرجى إدخال رابط كلمة المفتاح للعمل موجودة بالفعل، يرجى إدخال أخرى مختلفة نجاح + Failed to update search source. The item may have been removed. تلميح: لا تحتاج لوضع صور مخصصة في هذا الدليل، إذا تم تحديث نسخة Flow سيتم فقدانها. سيقوم Flow تلقائيًا بنسخ أي صور خارج هذا الدليل إلى موقع الصور المخصص لـ WebSearch. عمليات البحث على الويب diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/cs.xaml b/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/cs.xaml index 2e49f4965..960e63c81 100644 --- a/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/cs.xaml +++ b/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/cs.xaml @@ -45,6 +45,7 @@ Zadejte URL Zadaný aktivační příkaz již existuje, zadejte jiný aktivační příkaz Úspěšné + Failed to update search source. The item may have been removed. Poznámka: Obrázky do této složky vkládat nemusíte, po aktualizaci Flow Launcheru zmizí. Flow Launcher automaticky zkopíruje obrázky mimo tuto složku do vlastního umístění obrázků pluginu. Webové vyhledávání diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/da.xaml b/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/da.xaml index 7bc145a68..90f20bcc4 100644 --- a/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/da.xaml +++ b/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/da.xaml @@ -45,6 +45,7 @@ Please enter a URL Action keyword already exists, please enter a different one Fortsæt + Failed to update search source. The item may have been removed. Hint: You do not need to place custom images in this directory, if Flow's version is updated they will be lost. Flow will automatically copy any images outside of this directory across to WebSearch's custom image location. Web Searches diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/de.xaml b/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/de.xaml index 41a798d44..ed9f35454 100644 --- a/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/de.xaml +++ b/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/de.xaml @@ -46,6 +46,7 @@ https://www.netflix.com/search?q={q} Bitte geben Sie eine URL ein Aktions-Schlüsselwort ist bereits vorhanden. Bitte geben Sie ein anderes ein Erfolg + Failed to update search source. The item may have been removed. Hinweis: Sie müssen keine benutzerdefinierten Bilder in diesem Verzeichnis ablegen, wenn die Version von Flow aktualisiert wird, gehen diese verloren. Flow kopiert automatisch jegliche Bilder außerhalb dieses Verzeichnisses herüber in den benutzerdefinierten Bildspeicherort von WebSearch. Web-Suchen diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/en.xaml b/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/en.xaml index c6a74a047..5d65e4462 100644 --- a/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/en.xaml +++ b/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/en.xaml @@ -47,6 +47,7 @@ Please enter a URL Action keyword already exists, please enter a different one Success + Failed to update search source. The item may have been removed. Hint: You do not need to place custom images in this directory, if Flow's version is updated they will be lost. Flow will automatically copy any images outside of this directory across to WebSearch's custom image location. Web Searches diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/es-419.xaml b/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/es-419.xaml index f170a8d73..232ead8d5 100644 --- a/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/es-419.xaml +++ b/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/es-419.xaml @@ -45,6 +45,7 @@ Por favor, introduzca una URL La palabra clave ya existe, por favor ingrese una diferente Éxitoso + Failed to update search source. The item may have been removed. Sugerencia: No es necesario colocar imágenes personalizadas en este directorio, si la versión de Flow se actualiza se perderán. Flow copiará automáticamente cualquier imagen fuera de este directorio a la ubicación de imagen personalizada de WebSearch. Búsqueda web diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/es.xaml b/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/es.xaml index 5c956d8f8..7daee625b 100644 --- a/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/es.xaml +++ b/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/es.xaml @@ -45,6 +45,7 @@ Por favor, introduzca una URL La palabra clave de acción ya está en uso, por favor, introduzca una diferente Correcto + Failed to update search source. The item may have been removed. Sugerencia: No es necesario colocar imágenes personalizadas en esta carpeta, al actualizar Flow se perderán. Flow copiará automáticamente cualquier imagen externa a esta carpeta en la ubicación de imágenes personalizada de WebSearch. Búsquedas Web diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/fr.xaml b/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/fr.xaml index 3c9003ebf..f185a4b50 100644 --- a/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/fr.xaml +++ b/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/fr.xaml @@ -45,6 +45,7 @@ Veuillez saisir une URL Le mot clé existe déjà, veuillez en saisir un autre Ajout + Impossible de mettre à jour la source de recherche. L'élément a peut-être été supprimé. Astuce : Vous n'avez pas besoin de placer des images personnalisées dans ce dossier, si la version de Flow est mise à jour, elles seront perdues. Flow copiera automatiquement toutes les images en dehors de ce dossier dans l'emplacement de l'image personnalisée de la Recherche Web. Recherches web diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/he.xaml b/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/he.xaml index 583f63bde..e19ba1438 100644 --- a/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/he.xaml +++ b/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/he.xaml @@ -45,6 +45,7 @@ הזן כתובת URL מילת המפתח כבר קיימת, הזן אחת אחרת הצליח + Failed to update search source. The item may have been removed. רמז: אין צורך להוסיף תמונות מותאמות אישית לתיקייה זו, כיוון שבעדכון הבא של Flow הן יאבדו. Flow יעתיק אוטומטית תמונות שנמצאות מחוץ לתיקייה זו למיקום התמונות המותאמות אישית של WebSearch. חיפושי אינטרנט diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/it.xaml b/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/it.xaml index f250ecf3b..f6a44354e 100644 --- a/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/it.xaml +++ b/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/it.xaml @@ -45,6 +45,7 @@ Inserisci un URL La parola chiave esiste già, inserirne una diversa Successo + Failed to update search source. The item may have been removed. Suggerimento: Non è necessario inserire immagini personalizzate in questa cartella, se Flow viene aggiornato queste verranno perse. Flow copierà automaticamente tutte le immagini al di fuori di questa cartella nella posizione delle immagini personalizzate di WebSearch. Ricerche Web diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/ja.xaml b/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/ja.xaml index ebc7d6196..3ad1461e6 100644 --- a/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/ja.xaml +++ b/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/ja.xaml @@ -46,6 +46,7 @@ https://www.netflix.com/search?q={q} URLを入力してください キーワードはすでに存在します。違うキーワードを入力してください 成功しました + Failed to update search source. The item may have been removed. Hint: You do not need to place custom images in this directory, if Flow's version is updated they will be lost. Flow will automatically copy any images outside of this directory across to WebSearch's custom image location. Web検索 diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/ko.xaml b/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/ko.xaml index 9b8198779..df46aee90 100644 --- a/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/ko.xaml +++ b/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/ko.xaml @@ -43,6 +43,7 @@ URL을 입력하세요 액션 키워드가 이미 존재합니다. 다른 것을 입력해주세요. 성공 + Failed to update search source. The item may have been removed. Hint: You do not need to place custom images in this directory, if Flow's version is updated they will be lost. Flow will automatically copy any images outside of this directory across to WebSearch's custom image location. 웹 검색 diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/nb.xaml b/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/nb.xaml index 93c48b545..d648efcdf 100644 --- a/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/nb.xaml +++ b/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/nb.xaml @@ -45,6 +45,7 @@ Angi en nettadresse Nøkkelord for handlingen eksisterer allerede, velg et annet Vellykket + Failed to update search source. The item may have been removed. Tips: du trenger ikke å plassere egendefinerte bilder i denne katalogen, dersom versjonen av Flow blir oppdatert vil de gå tapt. Flow vil automatisk kopiere bilder utenfor denne katalogen over til WebSearch sin egendefinerte bildeplassering. Nettbaserte søk diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/nl.xaml b/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/nl.xaml index 25187d0b6..820004fd7 100644 --- a/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/nl.xaml +++ b/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/nl.xaml @@ -45,6 +45,7 @@ Please enter a URL Action keyword already exists, please enter a different one Succesvol + Failed to update search source. The item may have been removed. Hint: You do not need to place custom images in this directory, if Flow's version is updated they will be lost. Flow will automatically copy any images outside of this directory across to WebSearch's custom image location. Web Searches diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/pl.xaml b/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/pl.xaml index bc32a1b7e..1b562a8c2 100644 --- a/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/pl.xaml +++ b/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/pl.xaml @@ -45,6 +45,7 @@ Musisz wpisać adres URL Ten wyzwalacz jest już używany, musisz wybrać inny Sukces + Failed to update search source. The item may have been removed. Wskazówka: Nie musisz umieszczać niestandardowych obrazów w tym katalogu, ponieważ zostaną one utracone w przypadku aktualizacji wersji Flow. Flow automatycznie skopiuje wszystkie obrazy spoza tego katalogu do lokalizacji niestandardowych obrazów WebSearch. Wyszukiwarka WWW diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/pt-br.xaml b/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/pt-br.xaml index a581e91b2..6a6704b95 100644 --- a/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/pt-br.xaml +++ b/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/pt-br.xaml @@ -45,6 +45,7 @@ Please enter a URL Action keyword already exists, please enter a different one Sucesso + Failed to update search source. The item may have been removed. Hint: You do not need to place custom images in this directory, if Flow's version is updated they will be lost. Flow will automatically copy any images outside of this directory across to WebSearch's custom image location. Web Searches diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/pt-pt.xaml b/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/pt-pt.xaml index 22be076cb..21c0ff7cd 100644 --- a/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/pt-pt.xaml +++ b/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/pt-pt.xaml @@ -45,6 +45,7 @@ Introduza um URL Esta palavra-chave já existe. Por favor escolha outra. Sucesso + Falha ao atualizar a origem de pesquisa. O item pode ter sido removido. Dica: não é preciso colocar imagens personalizadas nesta pasta pois se Flow Launcher for atualizado, serão perdidas. Flow irá copiar todas as imagens que estejam fora desta pasta em todas as pesquisas Web. Pesquisas web diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/ru.xaml b/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/ru.xaml index 6539f9617..4435ba9c9 100644 --- a/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/ru.xaml +++ b/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/ru.xaml @@ -45,6 +45,7 @@ Please enter a URL Action keyword already exists, please enter a different one Успешно + Failed to update search source. The item may have been removed. Hint: You do not need to place custom images in this directory, if Flow's version is updated they will be lost. Flow will automatically copy any images outside of this directory across to WebSearch's custom image location. Web Searches diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/sk.xaml b/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/sk.xaml index 355ce984f..698283c23 100644 --- a/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/sk.xaml +++ b/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/sk.xaml @@ -45,6 +45,7 @@ Zadajte URL Zadaný aktivačný príkaz už existuje, zadajte iný aktivačný príkaz Úspešné + Nepodarilo sa aktualizovať zdroj vyhľadávania. Položka mohla byť odstránená. Poznámka: Do tohto priečinka nemusíte vkladať obrázky, ak sa Flow Launcher aktualizuje, zmiznú. Flow Launcher bude automaticky kopírovať obrázky mimo tohto priečinka naprieč vlastnému umiestneniu obrázkov pluginu. Webové vyhľadávanie diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/sr-Cyrl-RS.xaml b/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/sr-Cyrl-RS.xaml index cf24862c7..98a65928b 100644 --- a/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/sr-Cyrl-RS.xaml +++ b/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/sr-Cyrl-RS.xaml @@ -45,6 +45,7 @@ Please enter a URL Action keyword already exists, please enter a different one Success + Failed to update search source. The item may have been removed. Hint: You do not need to place custom images in this directory, if Flow's version is updated they will be lost. Flow will automatically copy any images outside of this directory across to WebSearch's custom image location. Web Searches diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/sr.xaml b/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/sr.xaml index 695c88c30..205d8edcc 100644 --- a/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/sr.xaml +++ b/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/sr.xaml @@ -45,6 +45,7 @@ Please enter a URL Action keyword already exists, please enter a different one Uspešno + Failed to update search source. The item may have been removed. Hint: You do not need to place custom images in this directory, if Flow's version is updated they will be lost. Flow will automatically copy any images outside of this directory across to WebSearch's custom image location. Web Searches diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/tr.xaml b/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/tr.xaml index 1a9fdbf03..8c2dd2104 100644 --- a/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/tr.xaml +++ b/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/tr.xaml @@ -45,6 +45,7 @@ Lütfen bir URL giriniz Anahtar kelime zaten mevcut. Lütfen yeni bir tane seçiniz. Başarılı + Failed to update search source. The item may have been removed. İpucu: Bu dizine özel resimler yerleştirmenize gerek yoktur, Flow'un sürümü güncellenirse bunlar kaybolacaktır. Flow, bu dizinin dışındaki tüm görüntüleri otomatik olarak WebSearch'ün özel görüntü konumuna kopyalayacaktır. Web Araması diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/uk-UA.xaml b/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/uk-UA.xaml index 72cfb23c2..3fe7068d1 100644 --- a/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/uk-UA.xaml +++ b/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/uk-UA.xaml @@ -45,6 +45,7 @@ Будь ласка, введіть URL-адресу Ключове слово дії вже існує, будь ласка, введіть інше Успішно + Failed to update search source. The item may have been removed. Підказка: Вам не потрібно розміщувати власні зображення в цьому каталозі, якщо версія Flow оновиться, вони будуть втрачені. Flow автоматично копіює всі зображення з цього каталогу до спеціального каталогу WebSearch. Вебпошук diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/vi.xaml b/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/vi.xaml index fb99024ec..1da790eee 100644 --- a/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/vi.xaml +++ b/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/vi.xaml @@ -45,6 +45,7 @@ Hãy nhập URL Từ khóa hành động đã tồn tại, vui lòng nhập một từ khóa khác Thành công + Failed to update search source. The item may have been removed. Gợi ý: Bạn không cần đặt hình ảnh tùy chỉnh trong thư mục này, nếu phiên bản của Flow được cập nhật, chúng sẽ bị mất. Flow sẽ tự động sao chép mọi hình ảnh bên ngoài thư mục này sang vị trí hình ảnh tùy chỉnh của WebSearch. Tìm kiếm Web diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/zh-cn.xaml b/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/zh-cn.xaml index fff4a2c8d..230c587c3 100644 --- a/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/zh-cn.xaml +++ b/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/zh-cn.xaml @@ -45,6 +45,7 @@ 请输入URL 触发关键字已经存在,请选择一个新的关键字 操作成功 + 更新搜索来源失败。该项可能已被删除。 提示:您不需要在此目录中放置自定义图像,当 Flow 更新时,该目录下内容将会丢失。Flow 会自动将此目录之外的所有图像复制到网页搜索的自定义图像位置。 网页搜索 diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/zh-tw.xaml b/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/zh-tw.xaml index 9ce6c88db..9bb37f2ec 100644 --- a/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/zh-tw.xaml +++ b/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/zh-tw.xaml @@ -45,6 +45,7 @@ 請輸入 URL 觸發關鍵字已經存在,請選擇一個新的關鍵字 操作成功 + Failed to update search source. The item may have been removed. Hint: You do not need to place custom images in this directory, if Flow's version is updated they will be lost. Flow will automatically copy any images outside of this directory across to WebSearch's custom image location. 網頁搜尋 diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/SearchSourceSetting.xaml.cs b/Plugins/Flow.Launcher.Plugin.WebSearch/SearchSourceSetting.xaml.cs index acc2c1e5c..9508d61a0 100644 --- a/Plugins/Flow.Launcher.Plugin.WebSearch/SearchSourceSetting.xaml.cs +++ b/Plugins/Flow.Launcher.Plugin.WebSearch/SearchSourceSetting.xaml.cs @@ -108,9 +108,19 @@ namespace Flow.Launcher.Plugin.WebSearch _context.API.AddActionKeyword(id, newKeyword); var index = _searchSources.IndexOf(_oldSearchSource); - _searchSources[index] = _searchSource; - - Close(); + + // Only update if we found the item in the collection + if (index >= 0 && index < _searchSources.Count) + { + _searchSources[index] = _searchSource; + Close(); + } + else + { + var warning = _api.GetTranslation("flowlauncher_plugin_websearch_edit_failed"); + _context.API.ShowMsgBox(warning); + Close(); + } } else { diff --git a/Plugins/Flow.Launcher.Plugin.WindowsSettings/Properties/Resources.ko-KR.resx b/Plugins/Flow.Launcher.Plugin.WindowsSettings/Properties/Resources.ko-KR.resx index 71f1a327a..25d6c87bb 100644 --- a/Plugins/Flow.Launcher.Plugin.WindowsSettings/Properties/Resources.ko-KR.resx +++ b/Plugins/Flow.Launcher.Plugin.WindowsSettings/Properties/Resources.ko-KR.resx @@ -254,7 +254,7 @@ 시계 및 지역 - Control Panel + 제어판 Cortana @@ -547,7 +547,7 @@ Area Control Panel (legacy settings) - deuteranopia + 녹색맹 Medical: Mean you don't can see red colors @@ -627,7 +627,7 @@ Area NetworkAndInternet - Exploit Protection + 악용 방지 추가 @@ -654,7 +654,7 @@ Area Privacy - FindFast + 빠른 찾기 Area Control Panel (legacy settings) @@ -721,7 +721,7 @@ Area Control Panel (legacy settings) - Glance + 힐끗 보기 Area Personalization, Deprecated in Windows 10, version 1809 and later @@ -865,7 +865,7 @@ Area Apps - Messaging + 메시징 Area Privacy @@ -876,7 +876,7 @@ Area Privacy - Microsoft Mail Post Office + Microsoft 메일 포스트 오피스 Area Control Panel (legacy settings) @@ -899,7 +899,7 @@ File name, Should not translated - Mono + 모노 자세한 내용 @@ -1251,7 +1251,7 @@ Area System - protanopia + 적색맹 Medical: Mean you don't can see green colors @@ -1366,7 +1366,7 @@ Should not translated - Security Center + 보안 센터 Area Control Panel (legacy settings) @@ -1544,7 +1544,7 @@ 투명도 - tritanopia + 청색맹 Medical: Mean you don't can see yellow and blue colors @@ -1552,7 +1552,7 @@ Area UpdateAndSecurity - TruePlay + 트루플레이 Area Gaming @@ -1639,15 +1639,15 @@ 창 테두리 - Windows Anytime Upgrade + Windows 언제든지 업그레이드 Area Control Panel (legacy settings) - Windows Anywhere + Windows 애니웨어 Area UserAccounts, device must be Windows Anywhere-capable - Windows CardSpace + Windows 카드스페이스 Area Control Panel (legacy settings) @@ -2503,7 +2503,7 @@ Get more features with a new edition of Windows - Control Panel + 제어판 TaskLink diff --git a/appveyor.yml b/appveyor.yml index f95b8dc08..b015c19ab 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: '2.0.1.{build}' +version: '2.0.2.{build}' # Do not build on tags because we create a release on merge to master. Otherwise will upload artifacts twice changing the hash, as well as triggering duplicate GitHub release action & NuGet deployments. skip_tags: true