mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-12-12 02:09:24 +08:00
[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:
parent
bee877fe41
commit
c1a80a2001
@ -83,9 +83,12 @@ namespace Community.PowerToys.Run.Plugin.WebSearch
|
|||||||
{
|
{
|
||||||
if (!Helper.OpenInShell(_browserPath, arguments))
|
if (!Helper.OpenInShell(_browserPath, arguments))
|
||||||
{
|
{
|
||||||
|
string errorMsgString = string.Format(CultureInfo.CurrentCulture, Properties.Resources.plugin_search_failed, _browserName);
|
||||||
|
|
||||||
|
Log.Error(errorMsgString, GetType());
|
||||||
_context.API.ShowMsg(
|
_context.API.ShowMsg(
|
||||||
$"Plugin: {Properties.Resources.plugin_name}",
|
$"Plugin: {Properties.Resources.plugin_name}",
|
||||||
$"{Properties.Resources.plugin_search_failed}: ");
|
errorMsgString);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -124,9 +127,12 @@ namespace Community.PowerToys.Run.Plugin.WebSearch
|
|||||||
{
|
{
|
||||||
if (!Helper.OpenInShell(_browserPath, arguments))
|
if (!Helper.OpenInShell(_browserPath, arguments))
|
||||||
{
|
{
|
||||||
|
string errorMsgString = string.Format(CultureInfo.CurrentCulture, Properties.Resources.plugin_search_failed, _browserName);
|
||||||
|
|
||||||
|
Log.Error(errorMsgString, GetType());
|
||||||
_context.API.ShowMsg(
|
_context.API.ShowMsg(
|
||||||
$"Plugin: {Properties.Resources.plugin_name}",
|
$"Plugin: {Properties.Resources.plugin_name}",
|
||||||
$"{Properties.Resources.plugin_search_failed}: ");
|
errorMsgString);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -141,9 +147,12 @@ namespace Community.PowerToys.Run.Plugin.WebSearch
|
|||||||
{
|
{
|
||||||
if (!Helper.OpenInShell(url))
|
if (!Helper.OpenInShell(url))
|
||||||
{
|
{
|
||||||
|
string errorMsgString = string.Format(CultureInfo.CurrentCulture, Properties.Resources.plugin_search_failed, _browserName);
|
||||||
|
|
||||||
|
Log.Error(errorMsgString, GetType());
|
||||||
_context.API.ShowMsg(
|
_context.API.ShowMsg(
|
||||||
$"Plugin: {Properties.Resources.plugin_name}",
|
$"Plugin: {Properties.Resources.plugin_name}",
|
||||||
$"{Properties.Resources.plugin_search_failed}: ");
|
errorMsgString);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ namespace Community.PowerToys.Run.Plugin.WebSearch.Properties {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <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>
|
/// </summary>
|
||||||
public static string plugin_description {
|
public static string plugin_description {
|
||||||
get {
|
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>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to In {0}.
|
/// Looks up a localized string similar to In {0}.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -115,7 +124,7 @@ namespace Community.PowerToys.Run.Plugin.WebSearch.Properties {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <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>
|
/// </summary>
|
||||||
public static string plugin_search_failed {
|
public static string plugin_search_failed {
|
||||||
get {
|
get {
|
||||||
|
@ -121,7 +121,7 @@
|
|||||||
<value>the default browser</value>
|
<value>the default browser</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="plugin_description" xml:space="preserve">
|
<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>
|
||||||
<data name="plugin_global_if_uri" xml:space="preserve">
|
<data name="plugin_global_if_uri" xml:space="preserve">
|
||||||
<value>Don't include in global results on queries that are URIs</value>
|
<value>Don't include in global results on queries that are URIs</value>
|
||||||
@ -140,6 +140,6 @@
|
|||||||
<value>Search the web in {0}</value>
|
<value>Search the web in {0}</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="plugin_search_failed" xml:space="preserve">
|
<data name="plugin_search_failed" xml:space="preserve">
|
||||||
<value>Failed to open the default browser</value>
|
<value>Failed to open {0}.</value>
|
||||||
</data>
|
</data>
|
||||||
</root>
|
</root>
|
Loading…
Reference in New Issue
Block a user