Skip to content

Commit 2ff8b5d

Browse files
author
Robert Holt
committed
Make new error messages into resource strings
1 parent cc3f16c commit 2ff8b5d

File tree

4 files changed

+47
-11
lines changed

4 files changed

+47
-11
lines changed

Rules/CompatibilityRules/UseCompatibleCommands.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ public static CommandCompatibilityDiagnostic Create(
231231
{
232232
string message = string.Format(
233233
CultureInfo.CurrentCulture,
234-
Strings.UseCompatibleCommandsError,
234+
Strings.UseCompatibleCommandsCommandError,
235235
commandName,
236236
platform.PowerShell.Version,
237237
platform.OperatingSystem.FriendlyName);
@@ -269,7 +269,7 @@ public static CommandCompatibilityDiagnostic CreateForParameter(
269269
{
270270
string message = string.Format(
271271
CultureInfo.CurrentCulture,
272-
"The parameter '{0}' is not available for command '{1}' in PowerShell '{2}' on '{3}'",
272+
Strings.UseCompatibleCommandsParameterError,
273273
parameterName,
274274
commandName,
275275
platform.PowerShell.Version,

Rules/CompatibilityRules/UseCompatibleTypes.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ public static TypeCompatibilityDiagnostic CreateForStaticMethod(
603603
{
604604
string message = String.Format(
605605
CultureInfo.CurrentCulture,
606-
"The method '{0}' on type '{1}' is not available in PowerShell {2} on platform '{3}'",
606+
Strings.UseCompatibleTypesMethodError,
607607
methodName,
608608
typeName,
609609
platform.PowerShell.Version,
@@ -645,7 +645,7 @@ public static TypeCompatibilityDiagnostic CreateForStaticProperty(
645645
{
646646
string message = String.Format(
647647
CultureInfo.CurrentCulture,
648-
"The member '{0}' on type '{1}' is not available in PowerShell {2} on platform '{3}'",
648+
Strings.UseCompatibleTypesMemberError,
649649
propertyName,
650650
typeName,
651651
platform.PowerShell.Version,

Rules/Strings.Designer.cs

Lines changed: 33 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Rules/Strings.resx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -819,9 +819,12 @@
819819
<data name="UseCompatibleCommandsDescription" xml:space="preserve">
820820
<value>Use commands compatible with the given PowerShell version and operating system</value>
821821
</data>
822-
<data name="UseCompatibleCommandsError" xml:space="preserve">
822+
<data name="UseCompatibleCommandsCommandError" xml:space="preserve">
823823
<value>The command '{0}' is not available by default in PowerShell version '{1}' on platform '{2}'</value>
824824
</data>
825+
<data name="UseCompatibleCommandsParameterError" xml:space="preserve">
826+
<value>The parameter '{0}' is not available for command '{1}' by default in PowerShell version '{2}' on platform '{3}'</value>
827+
</data>
825828
<data name="UseCompatibleTypesName" xml:space="preserve">
826829
<value>UseCompatibleTypes</value>
827830
</data>
@@ -834,6 +837,12 @@
834837
<data name="UseCompatibleTypesTypeError" xml:space="preserve">
835838
<value>The type '{0}' is not available by default in PowerShell version '{1}' on platform '{2}'</value>
836839
</data>
840+
<data name="UseCompatibleTypesMethodError" xml:space="preserve">
841+
<value>The method '{0}' is not available on type '{1}' by default in PowerShell version '{2}' on platform '{3}'</value>
842+
</data>
843+
<data name="UseCompatibleTypesMemberError" xml:space="preserve">
844+
<value>The member '{0}' is not available on type '{1}' by default in PowerShell version '{2}' on platform '{3}'</value>
845+
</data>
837846
<data name="UseCompatibleSyntaxName" xml:space="preserve">
838847
<value>UseCompatibleSyntax</value>
839848
</data>

0 commit comments

Comments
 (0)