[PT Run] Calculator plugin: Various improvements (#18159)

* crash fixes and error result

* small changes and test fixes

* improve exceptions and message

* double array crash fix

* overflowexception

* improve error handling

* varous improvements

* varous improvements

* fix spelling

* fix spelling

* Revert #16980

* add description

* error improvemenet

* Update tests

* spelling fixes

* small changes

* add settings

* last changes

* fix description

* update dev docs

* spell check
This commit is contained in:
Heiko
2022-06-02 11:44:12 +02:00
committed by GitHub
parent 9e4a58ee95
commit 465df35d27
13 changed files with 363 additions and 56 deletions

View File

@@ -19,7 +19,7 @@ namespace Microsoft.PowerToys.Run.Plugin.Calculator.Properties {
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
public class Resources {
@@ -45,7 +45,7 @@ namespace Microsoft.PowerToys.Run.Plugin.Calculator.Properties {
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
@@ -60,6 +60,15 @@ namespace Microsoft.PowerToys.Run.Plugin.Calculator.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Failed to calculate the input.
/// </summary>
public static string wox_plugin_calculator_calculation_failed {
get {
return ResourceManager.GetString("wox_plugin_calculator_calculation_failed", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Copy failed, please try later.
/// </summary>
@@ -68,7 +77,7 @@ namespace Microsoft.PowerToys.Run.Plugin.Calculator.Properties {
return ResourceManager.GetString("wox_plugin_calculator_copy_failed", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Copy this number to the clipboard.
/// </summary>
@@ -78,6 +87,15 @@ namespace Microsoft.PowerToys.Run.Plugin.Calculator.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Unsupported use of square brackets.
/// </summary>
public static string wox_plugin_calculator_double_array_returned {
get {
return ResourceManager.GetString("wox_plugin_calculator_double_array_returned", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Expression wrong or incomplete (Did you forget some parentheses?).
/// </summary>
@@ -88,14 +106,58 @@ namespace Microsoft.PowerToys.Run.Plugin.Calculator.Properties {
}
/// <summary>
/// Looks up a localized string similar to Not a number (NaN).
/// Looks up a localized string similar to Use English (United States) number format for input.
/// </summary>
public static string wox_plugin_calculator_in_en_format {
get {
return ResourceManager.GetString("wox_plugin_calculator_in_en_format", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Ignores your system setting and expects numbers in the format &apos;1,000.50&apos;.
/// </summary>
public static string wox_plugin_calculator_in_en_format_description {
get {
return ResourceManager.GetString("wox_plugin_calculator_in_en_format_description", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Calculation result is not a valid number (NaN).
/// </summary>
public static string wox_plugin_calculator_not_a_number {
get {
return ResourceManager.GetString("wox_plugin_calculator_not_a_number", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Result value was either too large or too small for a decimal number.
/// </summary>
public static string wox_plugin_calculator_not_covert_to_decimal {
get {
return ResourceManager.GetString("wox_plugin_calculator_not_covert_to_decimal", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Use English (United States) number format for output.
/// </summary>
public static string wox_plugin_calculator_out_en_format {
get {
return ResourceManager.GetString("wox_plugin_calculator_out_en_format", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Ignores your system setting and returns numbers in the format &apos;1000.50&apos;.
/// </summary>
public static string wox_plugin_calculator_out_en_format_description {
get {
return ResourceManager.GetString("wox_plugin_calculator_out_en_format_description", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Does mathematical calculations (e.g. 5*3-2)..
@@ -105,7 +167,7 @@ namespace Microsoft.PowerToys.Run.Plugin.Calculator.Properties {
return ResourceManager.GetString("wox_plugin_calculator_plugin_description", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Calculator.
/// </summary>

View File

@@ -124,7 +124,7 @@
<value>Does mathematical calculations (e.g. 5*3-2).</value>
</data>
<data name="wox_plugin_calculator_not_a_number" xml:space="preserve">
<value>Not a number (NaN)</value>
<value>Calculation result is not a valid number (NaN)</value>
</data>
<data name="wox_plugin_calculator_expression_not_complete" xml:space="preserve">
<value>Expression wrong or incomplete (Did you forget some parentheses?)</value>
@@ -135,4 +135,25 @@
<data name="wox_plugin_calculator_copy_failed" xml:space="preserve">
<value>Copy failed, please try later</value>
</data>
<data name="wox_plugin_calculator_calculation_failed" xml:space="preserve">
<value>Failed to calculate the input</value>
</data>
<data name="wox_plugin_calculator_double_array_returned" xml:space="preserve">
<value>Unsupported use of square brackets</value>
</data>
<data name="wox_plugin_calculator_not_covert_to_decimal" xml:space="preserve">
<value>Result value was either too large or too small for a decimal number</value>
</data>
<data name="wox_plugin_calculator_in_en_format" xml:space="preserve">
<value>Use English (United States) number format for input</value>
</data>
<data name="wox_plugin_calculator_in_en_format_description" xml:space="preserve">
<value>Ignores your system setting and expects numbers in the format '1,000.50'</value>
</data>
<data name="wox_plugin_calculator_out_en_format" xml:space="preserve">
<value>Use English (United States) number format for output</value>
</data>
<data name="wox_plugin_calculator_out_en_format_description" xml:space="preserve">
<value>Ignores your system setting and returns numbers in the format '1000.50'</value>
</data>
</root>