[PT Run] Web-search plugin: Fix strings and improve log msg (#15144)

* string fixes

* fix msg ending

* improve log

* Move failed message dot
This commit is contained in:
Heiko 2021-12-27 21:20:11 +01:00 committed by GitHub
parent bee877fe41
commit c1a80a2001
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 7 deletions

View File

@ -83,9 +83,12 @@ namespace Community.PowerToys.Run.Plugin.WebSearch
{
if (!Helper.OpenInShell(_browserPath, arguments))
{
string errorMsgString = string.Format(CultureInfo.CurrentCulture, Properties.Resources.plugin_search_failed, _browserName);
Log.Error(errorMsgString, GetType());
_context.API.ShowMsg(
$"Plugin: {Properties.Resources.plugin_name}",
$"{Properties.Resources.plugin_search_failed}: ");
errorMsgString);
return false;
}
@ -124,9 +127,12 @@ namespace Community.PowerToys.Run.Plugin.WebSearch
{
if (!Helper.OpenInShell(_browserPath, arguments))
{
string errorMsgString = string.Format(CultureInfo.CurrentCulture, Properties.Resources.plugin_search_failed, _browserName);
Log.Error(errorMsgString, GetType());
_context.API.ShowMsg(
$"Plugin: {Properties.Resources.plugin_name}",
$"{Properties.Resources.plugin_search_failed}: ");
errorMsgString);
return false;
}
@ -141,9 +147,12 @@ namespace Community.PowerToys.Run.Plugin.WebSearch
{
if (!Helper.OpenInShell(url))
{
string errorMsgString = string.Format(CultureInfo.CurrentCulture, Properties.Resources.plugin_search_failed, _browserName);
Log.Error(errorMsgString, GetType());
_context.API.ShowMsg(
$"Plugin: {Properties.Resources.plugin_name}",
$"{Properties.Resources.plugin_search_failed}: ");
errorMsgString);
return false;
}

View File

@ -70,7 +70,7 @@ namespace Community.PowerToys.Run.Plugin.WebSearch.Properties {
}
/// <summary>
/// Looks up a localized string similar to Search the web..
/// Looks up a localized string similar to Search the web in your default browser using your default search engine..
/// </summary>
public static string plugin_description {
get {
@ -87,6 +87,15 @@ namespace Community.PowerToys.Run.Plugin.WebSearch.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to In the default browser.
/// </summary>
public static string plugin_in_browser {
get {
return ResourceManager.GetString("plugin_in_browser", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to In {0}.
/// </summary>
@ -115,7 +124,7 @@ namespace Community.PowerToys.Run.Plugin.WebSearch.Properties {
}
/// <summary>
/// Looks up a localized string similar to Failed to open the default browser.
/// Looks up a localized string similar to Failed to open {0}..
/// </summary>
public static string plugin_search_failed {
get {

View File

@ -121,7 +121,7 @@
<value>the default browser</value>
</data>
<data name="plugin_description" xml:space="preserve">
<value>Search the web.</value>
<value>Search the web in your default browser using your default search engine.</value>
</data>
<data name="plugin_global_if_uri" xml:space="preserve">
<value>Don't include in global results on queries that are URIs</value>
@ -140,6 +140,6 @@
<value>Search the web in {0}</value>
</data>
<data name="plugin_search_failed" xml:space="preserve">
<value>Failed to open the default browser</value>
<value>Failed to open {0}.</value>
</data>
</root>