Skip to content

Commit

Permalink
Make new error messages into resource strings
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Holt committed Feb 14, 2019
1 parent cc3f16c commit 2ff8b5d
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 11 deletions.
4 changes: 2 additions & 2 deletions Rules/CompatibilityRules/UseCompatibleCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ public static CommandCompatibilityDiagnostic Create(
{
string message = string.Format(
CultureInfo.CurrentCulture,
Strings.UseCompatibleCommandsError,
Strings.UseCompatibleCommandsCommandError,
commandName,
platform.PowerShell.Version,
platform.OperatingSystem.FriendlyName);
Expand Down Expand Up @@ -269,7 +269,7 @@ public static CommandCompatibilityDiagnostic CreateForParameter(
{
string message = string.Format(
CultureInfo.CurrentCulture,
"The parameter '{0}' is not available for command '{1}' in PowerShell '{2}' on '{3}'",
Strings.UseCompatibleCommandsParameterError,
parameterName,
commandName,
platform.PowerShell.Version,
Expand Down
4 changes: 2 additions & 2 deletions Rules/CompatibilityRules/UseCompatibleTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ public static TypeCompatibilityDiagnostic CreateForStaticMethod(
{
string message = String.Format(
CultureInfo.CurrentCulture,
"The method '{0}' on type '{1}' is not available in PowerShell {2} on platform '{3}'",
Strings.UseCompatibleTypesMethodError,
methodName,
typeName,
platform.PowerShell.Version,
Expand Down Expand Up @@ -645,7 +645,7 @@ public static TypeCompatibilityDiagnostic CreateForStaticProperty(
{
string message = String.Format(
CultureInfo.CurrentCulture,
"The member '{0}' on type '{1}' is not available in PowerShell {2} on platform '{3}'",
Strings.UseCompatibleTypesMemberError,
propertyName,
typeName,
platform.PowerShell.Version,
Expand Down
39 changes: 33 additions & 6 deletions Rules/Strings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 10 additions & 1 deletion Rules/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -819,9 +819,12 @@
<data name="UseCompatibleCommandsDescription" xml:space="preserve">
<value>Use commands compatible with the given PowerShell version and operating system</value>
</data>
<data name="UseCompatibleCommandsError" xml:space="preserve">
<data name="UseCompatibleCommandsCommandError" xml:space="preserve">
<value>The command '{0}' is not available by default in PowerShell version '{1}' on platform '{2}'</value>
</data>
<data name="UseCompatibleCommandsParameterError" xml:space="preserve">
<value>The parameter '{0}' is not available for command '{1}' by default in PowerShell version '{2}' on platform '{3}'</value>
</data>
<data name="UseCompatibleTypesName" xml:space="preserve">
<value>UseCompatibleTypes</value>
</data>
Expand All @@ -834,6 +837,12 @@
<data name="UseCompatibleTypesTypeError" xml:space="preserve">
<value>The type '{0}' is not available by default in PowerShell version '{1}' on platform '{2}'</value>
</data>
<data name="UseCompatibleTypesMethodError" xml:space="preserve">
<value>The method '{0}' is not available on type '{1}' by default in PowerShell version '{2}' on platform '{3}'</value>
</data>
<data name="UseCompatibleTypesMemberError" xml:space="preserve">
<value>The member '{0}' is not available on type '{1}' by default in PowerShell version '{2}' on platform '{3}'</value>
</data>
<data name="UseCompatibleSyntaxName" xml:space="preserve">
<value>UseCompatibleSyntax</value>
</data>
Expand Down

0 comments on commit 2ff8b5d

Please sign in to comment.