From c25a5a821f8e87b498467a42ee9bd8467e7abc82 Mon Sep 17 00:00:00 2001 From: Franky Chen Date: Sat, 25 Dec 2021 00:06:02 +0800 Subject: [PATCH] [PT Run]Align subtitles for web search plugin (#15129) * Align subtitles, #15126 * Apply suggestions from code review * Add comment to the resource file * Remove unused resource --- .../Community.PowerToys.Run.Plugin.WebSearch/Main.cs | 7 ++++--- .../Properties/Resources.Designer.cs | 6 +++--- .../Properties/Resources.resx | 4 ++++ 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.WebSearch/Main.cs b/src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.WebSearch/Main.cs index e99a3ba4e6..c03498d025 100644 --- a/src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.WebSearch/Main.cs +++ b/src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.WebSearch/Main.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; +using System.Globalization; using System.IO.Abstractions; using System.Linq; using System.Text; @@ -74,7 +75,7 @@ namespace Community.PowerToys.Run.Plugin.WebSearch results.Add(new Result { Title = Properties.Resources.plugin_description.Remove(Description.Length - 1, 1), - SubTitle = Properties.Resources.plugin_in_browser, + SubTitle = string.Format(CultureInfo.CurrentCulture, Properties.Resources.plugin_in_browser_name, _browserName), QueryTextDisplay = string.Empty, IcoPath = _defaultIconPath, ProgramArguments = arguments, @@ -109,7 +110,7 @@ namespace Community.PowerToys.Run.Plugin.WebSearch var result = new Result { Title = searchTerm, - SubTitle = string.Format(System.Globalization.CultureInfo.CurrentCulture, Properties.Resources.plugin_open, _browserName), + SubTitle = string.Format(CultureInfo.CurrentCulture, Properties.Resources.plugin_open, _browserName), QueryTextDisplay = searchTerm, IcoPath = _defaultIconPath, }; @@ -134,7 +135,7 @@ namespace Community.PowerToys.Run.Plugin.WebSearch } else { - string url = string.Format(System.Globalization.CultureInfo.InvariantCulture, _searchEngineUrl, searchTerm); + string url = string.Format(CultureInfo.InvariantCulture, _searchEngineUrl, searchTerm); result.Action = action => { diff --git a/src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.WebSearch/Properties/Resources.Designer.cs b/src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.WebSearch/Properties/Resources.Designer.cs index 6e48115836..c10c4118ab 100644 --- a/src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.WebSearch/Properties/Resources.Designer.cs +++ b/src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.WebSearch/Properties/Resources.Designer.cs @@ -88,11 +88,11 @@ namespace Community.PowerToys.Run.Plugin.WebSearch.Properties { } /// - /// Looks up a localized string similar to In the default browser. + /// Looks up a localized string similar to In {0}. /// - public static string plugin_in_browser { + public static string plugin_in_browser_name { get { - return ResourceManager.GetString("plugin_in_browser", resourceCulture); + return ResourceManager.GetString("plugin_in_browser_name", resourceCulture); } } diff --git a/src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.WebSearch/Properties/Resources.resx b/src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.WebSearch/Properties/Resources.resx index 5899780264..05de32d75c 100644 --- a/src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.WebSearch/Properties/Resources.resx +++ b/src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.WebSearch/Properties/Resources.resx @@ -129,6 +129,10 @@ In the default browser + + In {0} + Like "Search the web in {the browser name}" + Web Search