diff --git a/Enigmatry.Entry.CodeGeneration.Tests/Angular/FilesToBeGenerated/mock-edit-generated.component.ts.txt b/Enigmatry.Entry.CodeGeneration.Tests/Angular/FilesToBeGenerated/mock-edit-generated.component.ts.txt index 5ae827a..b39fdbc 100644 --- a/Enigmatry.Entry.CodeGeneration.Tests/Angular/FilesToBeGenerated/mock-edit-generated.component.ts.txt +++ b/Enigmatry.Entry.CodeGeneration.Tests/Angular/FilesToBeGenerated/mock-edit-generated.component.ts.txt @@ -164,8 +164,8 @@ pattern: /[A-Z]/, }, validation: { messages: { -required: (err, field) => $localize `:@@CUSTOM_VALIDATION_MESSAGE_TRANSLATION_ID:CUSTOM_VALIDATION_MESSAGE`, -maxlength: (err, field) => $localize `:@@CUSTOM_VALIDATION_MESSAGE_TRANSLATION_ID:CUSTOM_VALIDATION_MESSAGE` +required: (_err, field) => $localize `:@@CUSTOM_VALIDATION_MESSAGE_TRANSLATION_ID:CUSTOM_VALIDATION_MESSAGE`, +maxlength: (_err, field) => $localize `:@@CUSTOM_VALIDATION_MESSAGE_TRANSLATION_ID:CUSTOM_VALIDATION_MESSAGE` } }, asyncValidators: { validation: [ 'uniqueName', 'isEnsured' ] }, @@ -266,8 +266,8 @@ max: 100, }, validation: { messages: { -min: (err, field) => $localize `:@@test.mock-edit.amount.min:CUSTOM_VALIDATION_MESSAGE`, -max: (err, field) => $localize `:@@test.mock-edit.amount.max:CUSTOM_VALIDATION_MESSAGE` +min: (_err, field) => $localize `:@@test.mock-edit.amount.min:CUSTOM_VALIDATION_MESSAGE`, +max: (_err, field) => $localize `:@@test.mock-edit.amount.max:CUSTOM_VALIDATION_MESSAGE` } }, }, @@ -659,7 +659,7 @@ maxLength: 50, }, validation: { messages: { -pattern: (err, field) => $localize `:@@test.mock-edit.email1.pattern:CUSTOM_VALIDATION_MESSAGE` +pattern: (_err, field) => $localize `:@@test.mock-edit.email1.pattern:CUSTOM_VALIDATION_MESSAGE` } }, }, @@ -688,7 +688,7 @@ maxLength: 50, }, validation: { messages: { -pattern: (err, field) => $localize `:@@validators.pattern.emailAddress:Invalid email address format` +pattern: (_err, field) => $localize `:@@validators.pattern.emailAddress:Invalid email address format` } }, }, diff --git a/Enigmatry.Entry.CodeGeneration.Tests/Angular/FilesToBeGenerated/test-generated.module.ts.txt b/Enigmatry.Entry.CodeGeneration.Tests/Angular/FilesToBeGenerated/test-generated.module.ts.txt index 091a01c..2967bb6 100644 --- a/Enigmatry.Entry.CodeGeneration.Tests/Angular/FilesToBeGenerated/test-generated.module.ts.txt +++ b/Enigmatry.Entry.CodeGeneration.Tests/Angular/FilesToBeGenerated/test-generated.module.ts.txt @@ -31,10 +31,10 @@ import { CustomValidatorsService, customValidatorsFactory } from 'src/app/shared FormlyModule.forChild( { validationMessages: [ -{ name: 'maxlength', message: (err, field) => $localize `:@@validators.maxLength:${field?.templateOptions?.label}:property-name: value should be less than ${field?.templateOptions?.maxLength}:max-value: characters` }, -{ name: 'pattern', message: (err, field) => $localize `:@@validators.pattern:${field?.templateOptions?.label}:property-name: is not in valid format` }, -{ name: 'max', message: (err, field) => $localize `:@@validators.max:${field?.templateOptions?.label}:property-name: value should be less than ${field?.templateOptions?.max}:max-value:` }, -{ name: 'required', message: (err, field) => $localize `:@@validators.required:${field?.templateOptions?.label}:property-name: is required` } +{ name: 'maxlength', message: (_err, field) => $localize `:@@validators.maxLength:${field?.props?.label}:property-name: value should be less than ${field?.templateOptions?.maxLength}:max-value: characters` }, +{ name: 'pattern', message: (_err, field) => $localize `:@@validators.pattern:${field?.props?.label}:property-name: is not in valid format` }, +{ name: 'max', message: (_err, field) => $localize `:@@validators.max:${field?.props?.label}:property-name: value should be less than ${field?.templateOptions?.max}:max-value:` }, +{ name: 'required', message: (_err, field) => $localize `:@@validators.required:${field?.props?.label}:property-name: is required` } ] } ), diff --git a/Enigmatry.Entry.CodeGeneration.Tests/Angular/HtmlHelperExtensions/AngularFormlyValidationHtmlHelperExtensionsFixture.cs b/Enigmatry.Entry.CodeGeneration.Tests/Angular/HtmlHelperExtensions/AngularFormlyValidationHtmlHelperExtensionsFixture.cs index e518842..c5c026c 100644 --- a/Enigmatry.Entry.CodeGeneration.Tests/Angular/HtmlHelperExtensions/AngularFormlyValidationHtmlHelperExtensionsFixture.cs +++ b/Enigmatry.Entry.CodeGeneration.Tests/Angular/HtmlHelperExtensions/AngularFormlyValidationHtmlHelperExtensionsFixture.cs @@ -63,13 +63,13 @@ public string AddAsyncValidators(string propertyName) } [TestCase(nameof(FormMock.Name), ExpectedResult = - "required: (err, field) => $localize `:@@CUSTOM_VALIDATION_MESSAGE_TRANSLATION_ID:CUSTOM_VALIDATION_MESSAGE`," + - "maxLength: (err, field) => $localize `:@@CUSTOM_VALIDATION_MESSAGE_TRANSLATION_ID:CUSTOM_VALIDATION_MESSAGE`")] + "required: (_err, field) => $localize `:@@CUSTOM_VALIDATION_MESSAGE_TRANSLATION_ID:CUSTOM_VALIDATION_MESSAGE`," + + "maxLength: (_err, field) => $localize `:@@CUSTOM_VALIDATION_MESSAGE_TRANSLATION_ID:CUSTOM_VALIDATION_MESSAGE`")] [TestCase(nameof(FormMock.Amount), ExpectedResult = - "min: (err, field) => $localize `:@@test.mock-edit.amount.min:CUSTOM_VALIDATION_MESSAGE`," + - "max: (err, field) => $localize `:@@test.mock-edit.amount.max:CUSTOM_VALIDATION_MESSAGE`")] - [TestCase(nameof(FormMock.Email1), ExpectedResult = "pattern: (err, field) => $localize `:@@test.mock-edit.email1.pattern:CUSTOM_VALIDATION_MESSAGE`")] - [TestCase(nameof(FormMock.Email2), ExpectedResult = "pattern: (err, field) => $localize `:@@validators.pattern.emailAddress:Invalid email address format`")] + "min: (_err, field) => $localize `:@@test.mock-edit.amount.min:CUSTOM_VALIDATION_MESSAGE`," + + "max: (_err, field) => $localize `:@@test.mock-edit.amount.max:CUSTOM_VALIDATION_MESSAGE`")] + [TestCase(nameof(FormMock.Email1), ExpectedResult = "pattern: (_err, field) => $localize `:@@test.mock-edit.email1.pattern:CUSTOM_VALIDATION_MESSAGE`")] + [TestCase(nameof(FormMock.Email2), ExpectedResult = "pattern: (_err, field) => $localize `:@@validators.pattern.emailAddress:Invalid email address format`")] public string AddCustomValidationMessages(string propertyName) { var formControl = _formComponent.FormControlsOfType().Single(x => x.PropertyName == propertyName.Camelize()); @@ -77,10 +77,10 @@ public string AddCustomValidationMessages(string propertyName) } [TestCase(ExpectedResult = - "{ name: 'maxLength', message: (err, field) => $localize `:@@validators.maxLength:${field?.templateOptions?.label}:property-name: value should be less than ${field?.templateOptions?.maxLength}:max-value: characters` }," + - "{ name: 'pattern', message: (err, field) => $localize `:@@validators.pattern:${field?.templateOptions?.label}:property-name: is not in valid format` }," + - "{ name: 'max', message: (err, field) => $localize `:@@validators.max:${field?.templateOptions?.label}:property-name: value should be less than ${field?.templateOptions?.max}:max-value:` }," + - "{ name: 'required', message: (err, field) => $localize `:@@validators.required:${field?.templateOptions?.label}:property-name: is required` }")] + "{ name: 'maxLength', message: (_err, field) => $localize `:@@validators.maxLength:${field?.props?.label}:property-name: value should be less than ${field?.templateOptions?.maxLength}:max-value: characters` }," + + "{ name: 'pattern', message: (_err, field) => $localize `:@@validators.pattern:${field?.props?.label}:property-name: is not in valid format` }," + + "{ name: 'max', message: (_err, field) => $localize `:@@validators.max:${field?.props?.label}:property-name: value should be less than ${field?.templateOptions?.max}:max-value:` }," + + "{ name: 'required', message: (_err, field) => $localize `:@@validators.required:${field?.props?.label}:property-name: is required` }")] public string AddCommonValidationMessages() => _htmlHelper.AddCommonValidationMessages(_featureModule, true)?.ToString()?.Replace("\r\n", "") ?? ""; diff --git a/Enigmatry.Entry.CodeGeneration.Validation.Tests/InitialPropertyValidationBuilderExtensionsFixtures.cs b/Enigmatry.Entry.CodeGeneration.Validation.Tests/InitialPropertyValidationBuilderExtensionsFixtures.cs index 420c586..1beaf76 100644 --- a/Enigmatry.Entry.CodeGeneration.Validation.Tests/InitialPropertyValidationBuilderExtensionsFixtures.cs +++ b/Enigmatry.Entry.CodeGeneration.Validation.Tests/InitialPropertyValidationBuilderExtensionsFixtures.cs @@ -40,7 +40,7 @@ public void IsRequired() _validationConfiguration.ValidationRules.Single().FormlyTemplateOptions .Should().BeEquivalentTo("required: true"); _validationConfiguration.ValidationRules.Single().FormlyValidationMessage - .Should().Be("${field?.templateOptions?.label}:property-name: is required"); + .Should().Be("${field?.props?.label}:property-name: is required"); } [Test] @@ -61,7 +61,7 @@ public void Match() _validationConfiguration.ValidationRules.Single().FormlyTemplateOptions .Should().BeEquivalentTo("pattern: /^[A-Z]{4}[1-9]{8}$/mu"); _validationConfiguration.ValidationRules.Single().FormlyValidationMessage - .Should().Be("${field?.templateOptions?.label}:property-name: is not in valid format"); + .Should().Be("${field?.props?.label}:property-name: is not in valid format"); } [Test] @@ -103,7 +103,7 @@ public void MinLength() _validationConfiguration.ValidationRules.Single().FormlyTemplateOptions .Should().BeEquivalentTo("minLength: 0"); _validationConfiguration.ValidationRules.Single().FormlyValidationMessage - .Should().Be("${field?.templateOptions?.label}:property-name: should have at least ${field?.templateOptions?.minLength}:min-value: characters"); + .Should().Be("${field?.props?.label}:property-name: should have at least ${field?.templateOptions?.minLength}:min-value: characters"); } [Test] @@ -124,7 +124,7 @@ public void MaxLength() _validationConfiguration.ValidationRules.Single().FormlyTemplateOptions .Should().BeEquivalentTo("maxLength: 100"); _validationConfiguration.ValidationRules.Single().FormlyValidationMessage - .Should().Be("${field?.templateOptions?.label}:property-name: value should be less than ${field?.templateOptions?.maxLength}:max-value: characters"); + .Should().Be("${field?.props?.label}:property-name: value should be less than ${field?.templateOptions?.maxLength}:max-value: characters"); } [Test] @@ -141,14 +141,14 @@ public void Length() minRule.MessageTranslationId.Should().Be("validators.minLength"); minRule.FormlyTemplateOptions.Should().BeEquivalentTo("minLength: 10"); minRule.FormlyValidationMessage - .Should().Be("${field?.templateOptions?.label}:property-name: should have at least ${field?.templateOptions?.minLength}:min-value: characters"); + .Should().Be("${field?.props?.label}:property-name: should have at least ${field?.templateOptions?.minLength}:min-value: characters"); var maxRule = _validationConfiguration.ValidationRules.Single(x => x.FormlyRuleName == "maxLength"); maxRule.CustomMessage.Should().BeEmpty(); maxRule.MessageTranslationId.Should().Be("validators.maxLength"); maxRule.FormlyTemplateOptions.Should().BeEquivalentTo("maxLength: 10"); maxRule.FormlyValidationMessage - .Should().Be("${field?.templateOptions?.label}:property-name: value should be less than ${field?.templateOptions?.maxLength}:max-value: characters"); + .Should().Be("${field?.props?.label}:property-name: value should be less than ${field?.templateOptions?.maxLength}:max-value: characters"); } [Test] @@ -297,7 +297,7 @@ private static void AssertNumbercMinValidationRule(IFormlyValidationRule rule rule.FormlyTemplateOptions .Should().BeEquivalentTo("type: 'number'", $"min: {String.Format(CultureInfo.InvariantCulture, "{0}", value)}{(isEqual ? "" : $" + {GetIncrement()}")}"); rule.FormlyValidationMessage - .Should().Be("${field?.templateOptions?.label}:property-name: value should be more than ${field?.templateOptions?.min}:min-value:"); + .Should().Be("${field?.props?.label}:property-name: value should be more than ${field?.templateOptions?.min}:min-value:"); } private static void AssertNumbercMaxValidationRule(IFormlyValidationRule rule, T value, bool isEqual) @@ -311,7 +311,7 @@ private static void AssertNumbercMaxValidationRule(IFormlyValidationRule rule rule.FormlyTemplateOptions .Should().BeEquivalentTo("type: 'number'", $"max: {String.Format(CultureInfo.InvariantCulture, "{0}", value)}{(isEqual ? "" : $" - {GetIncrement()}")}"); rule.FormlyValidationMessage - .Should().Be("${field?.templateOptions?.label}:property-name: value should be less than ${field?.templateOptions?.max}:max-value:"); + .Should().Be("${field?.props?.label}:property-name: value should be less than ${field?.templateOptions?.max}:max-value:"); } private IFormlyValidationRule GetRuleByPropertyName(string propertyName) => diff --git a/Enigmatry.Entry.CodeGeneration.Validation.Tests/ValidationConfigurationFixture.cs b/Enigmatry.Entry.CodeGeneration.Validation.Tests/ValidationConfigurationFixture.cs index 1247a44..b4175bd 100644 --- a/Enigmatry.Entry.CodeGeneration.Validation.Tests/ValidationConfigurationFixture.cs +++ b/Enigmatry.Entry.CodeGeneration.Validation.Tests/ValidationConfigurationFixture.cs @@ -88,7 +88,7 @@ public void ValidationConfigurationForPatterns() validationConfiguration.ValidationRules .Select(x => x.FormlyValidationMessage) .Should().BeEquivalentTo( - "${field?.templateOptions?.label}:property-name: is not in valid format", + "${field?.props?.label}:property-name: is not in valid format", "Invalid email address format" ); } @@ -117,12 +117,12 @@ public void ValidationConfigurationForNullables() validationConfiguration.ValidationRules .Select(x => x.FormlyValidationMessage).Distinct() .Should().BeEquivalentTo( - "${field?.templateOptions?.label}:property-name: is required", - "${field?.templateOptions?.label}:property-name: value should be more than ${field?.templateOptions?.min}:min-value:", - "${field?.templateOptions?.label}:property-name: value should be less than ${field?.templateOptions?.max}:max-value:", - "${field?.templateOptions?.label}:property-name: should have at least ${field?.templateOptions?.minLength}:min-value: characters", - "${field?.templateOptions?.label}:property-name: value should be less than ${field?.templateOptions?.maxLength}:max-value: characters", - "${field?.templateOptions?.label}:property-name: is not in valid format" + "${field?.props?.label}:property-name: is required", + "${field?.props?.label}:property-name: value should be more than ${field?.templateOptions?.min}:min-value:", + "${field?.props?.label}:property-name: value should be less than ${field?.templateOptions?.max}:max-value:", + "${field?.props?.label}:property-name: should have at least ${field?.templateOptions?.minLength}:min-value: characters", + "${field?.props?.label}:property-name: value should be less than ${field?.templateOptions?.maxLength}:max-value: characters", + "${field?.props?.label}:property-name: is not in valid format" ); } } diff --git a/Enigmatry.Entry.CodeGeneration.Validation/ValidationRules/GreaterOrEqualToValidationRule.cs b/Enigmatry.Entry.CodeGeneration.Validation/ValidationRules/GreaterOrEqualToValidationRule.cs index 369a934..8525571 100644 --- a/Enigmatry.Entry.CodeGeneration.Validation/ValidationRules/GreaterOrEqualToValidationRule.cs +++ b/Enigmatry.Entry.CodeGeneration.Validation/ValidationRules/GreaterOrEqualToValidationRule.cs @@ -22,5 +22,5 @@ public GreaterOrEqualToValidationRule(T value, PropertyInfo propertyInfo, Lambda public override string FormlyValidationMessage => HasCustomMessage ? CustomMessage - : "${field?.templateOptions?.label}:property-name: value should be more than ${field?.templateOptions?.min}:min-value:"; + : "${field?.props?.label}:property-name: value should be more than ${field?.templateOptions?.min}:min-value:"; } \ No newline at end of file diff --git a/Enigmatry.Entry.CodeGeneration.Validation/ValidationRules/GreaterThenValidationRule.cs b/Enigmatry.Entry.CodeGeneration.Validation/ValidationRules/GreaterThenValidationRule.cs index 20e6b64..13a3214 100644 --- a/Enigmatry.Entry.CodeGeneration.Validation/ValidationRules/GreaterThenValidationRule.cs +++ b/Enigmatry.Entry.CodeGeneration.Validation/ValidationRules/GreaterThenValidationRule.cs @@ -22,5 +22,5 @@ public GreaterThenValidationRule(T value, PropertyInfo propertyInfo, LambdaExpre public override string FormlyValidationMessage => HasCustomMessage ? CustomMessage - : "${field?.templateOptions?.label}:property-name: value should be more than ${field?.templateOptions?.min}:min-value:"; + : "${field?.props?.label}:property-name: value should be more than ${field?.templateOptions?.min}:min-value:"; } \ No newline at end of file diff --git a/Enigmatry.Entry.CodeGeneration.Validation/ValidationRules/IsRequiredValidationRule.cs b/Enigmatry.Entry.CodeGeneration.Validation/ValidationRules/IsRequiredValidationRule.cs index 33cefd3..44e713b 100644 --- a/Enigmatry.Entry.CodeGeneration.Validation/ValidationRules/IsRequiredValidationRule.cs +++ b/Enigmatry.Entry.CodeGeneration.Validation/ValidationRules/IsRequiredValidationRule.cs @@ -17,5 +17,5 @@ public IsRequiredValidationRule(PropertyInfo propertyInfo, LambdaExpression expr public override string FormlyValidationMessage => HasCustomMessage ? CustomMessage - : "${field?.templateOptions?.label}:property-name: is required"; -} \ No newline at end of file + : "${field?.props?.label}:property-name: is required"; +} diff --git a/Enigmatry.Entry.CodeGeneration.Validation/ValidationRules/LessOrEqualToValidationRule.cs b/Enigmatry.Entry.CodeGeneration.Validation/ValidationRules/LessOrEqualToValidationRule.cs index 1fde8df..ce98c85 100644 --- a/Enigmatry.Entry.CodeGeneration.Validation/ValidationRules/LessOrEqualToValidationRule.cs +++ b/Enigmatry.Entry.CodeGeneration.Validation/ValidationRules/LessOrEqualToValidationRule.cs @@ -22,5 +22,5 @@ public LessOrEqualToValidationRule(T value, PropertyInfo propertyInfo, LambdaExp public override string FormlyValidationMessage => HasCustomMessage ? CustomMessage - : "${field?.templateOptions?.label}:property-name: value should be less than ${field?.templateOptions?.max}:max-value:"; + : "${field?.props?.label}:property-name: value should be less than ${field?.templateOptions?.max}:max-value:"; } \ No newline at end of file diff --git a/Enigmatry.Entry.CodeGeneration.Validation/ValidationRules/LessThenValidationRule.cs b/Enigmatry.Entry.CodeGeneration.Validation/ValidationRules/LessThenValidationRule.cs index 50ecc11..39a369d 100644 --- a/Enigmatry.Entry.CodeGeneration.Validation/ValidationRules/LessThenValidationRule.cs +++ b/Enigmatry.Entry.CodeGeneration.Validation/ValidationRules/LessThenValidationRule.cs @@ -22,5 +22,5 @@ public LessThenValidationRule(T value, PropertyInfo propertyInfo, LambdaExpressi public override string FormlyValidationMessage => HasCustomMessage ? CustomMessage - : "${field?.templateOptions?.label}:property-name: value should be less than ${field?.templateOptions?.max}:max-value:"; -} \ No newline at end of file + : "${field?.props?.label}:property-name: value should be less than ${field?.templateOptions?.max}:max-value:"; +} diff --git a/Enigmatry.Entry.CodeGeneration.Validation/ValidationRules/MaxLengthValidationRule.cs b/Enigmatry.Entry.CodeGeneration.Validation/ValidationRules/MaxLengthValidationRule.cs index 5b6affe..0fa1c6c 100644 --- a/Enigmatry.Entry.CodeGeneration.Validation/ValidationRules/MaxLengthValidationRule.cs +++ b/Enigmatry.Entry.CodeGeneration.Validation/ValidationRules/MaxLengthValidationRule.cs @@ -14,5 +14,5 @@ public MaxLengthValidationRule(int value, PropertyInfo propertyInfo, LambdaExpre public override string FormlyValidationMessage => HasCustomMessage ? CustomMessage - : "${field?.templateOptions?.label}:property-name: value should be less than ${field?.templateOptions?.maxLength}:max-value: characters"; + : "${field?.props?.label}:property-name: value should be less than ${field?.templateOptions?.maxLength}:max-value: characters"; } \ No newline at end of file diff --git a/Enigmatry.Entry.CodeGeneration.Validation/ValidationRules/MinLengthValidationRule.cs b/Enigmatry.Entry.CodeGeneration.Validation/ValidationRules/MinLengthValidationRule.cs index 5785305..bc4baea 100644 --- a/Enigmatry.Entry.CodeGeneration.Validation/ValidationRules/MinLengthValidationRule.cs +++ b/Enigmatry.Entry.CodeGeneration.Validation/ValidationRules/MinLengthValidationRule.cs @@ -14,5 +14,5 @@ public MinLengthValidationRule(int value, PropertyInfo propertyInfo, LambdaExpre public override string FormlyValidationMessage => HasCustomMessage ? CustomMessage - : "${field?.templateOptions?.label}:property-name: should have at least ${field?.templateOptions?.minLength}:min-value: characters"; + : "${field?.props?.label}:property-name: should have at least ${field?.templateOptions?.minLength}:min-value: characters"; } \ No newline at end of file diff --git a/Enigmatry.Entry.CodeGeneration.Validation/ValidationRules/PatternValidationRule.cs b/Enigmatry.Entry.CodeGeneration.Validation/ValidationRules/PatternValidationRule.cs index 21f842c..1ff3ec1 100644 --- a/Enigmatry.Entry.CodeGeneration.Validation/ValidationRules/PatternValidationRule.cs +++ b/Enigmatry.Entry.CodeGeneration.Validation/ValidationRules/PatternValidationRule.cs @@ -19,5 +19,5 @@ public PatternValidationRule( public override string FormlyValidationMessage => HasCustomMessage ? CustomMessage - : "${field?.templateOptions?.label}:property-name: is not in valid format"; + : "${field?.props?.label}:property-name: is not in valid format"; } \ No newline at end of file diff --git a/Enigmatry.Entry.CodeGeneration/Templates/HtmlHelperExtensions/Angular/AngularFormlyValidationHtmlHelperExtensions.cs b/Enigmatry.Entry.CodeGeneration/Templates/HtmlHelperExtensions/Angular/AngularFormlyValidationHtmlHelperExtensions.cs index 51c40ae..2070f06 100644 --- a/Enigmatry.Entry.CodeGeneration/Templates/HtmlHelperExtensions/Angular/AngularFormlyValidationHtmlHelperExtensions.cs +++ b/Enigmatry.Entry.CodeGeneration/Templates/HtmlHelperExtensions/Angular/AngularFormlyValidationHtmlHelperExtensions.cs @@ -32,7 +32,7 @@ public static IHtmlContent AddCustomValidationMessages(this IHtmlHelper html, Fo .ValidationRules .Where(rule => rule.HasCustomMessage) .Select(x => enableI18N - ? $"{x.FormlyRuleName}: (err, field) => {AngularLocalization.Localize(x.MessageTranslationId, x.FormlyValidationMessage)}" + ? $"{x.FormlyRuleName}: (_err, field) => {AngularLocalization.Localize(x.MessageTranslationId, x.FormlyValidationMessage)}" : $"{x.FormlyRuleName}: '{x.FormlyValidationMessage}'" ); return html.Raw($"{String.Join(",\r\n", validationMessages)}\r\n"); @@ -56,7 +56,7 @@ public static IHtmlContent AddCommonValidationMessages(this IHtmlHelper html, Fe : $"`{rule.FormlyValidationMessage}`"; messages.Add( rule.FormlyRuleName, - $"{{ name: '{rule.FormlyRuleName}', message: (err, field) => {message} }}" + $"{{ name: '{rule.FormlyRuleName}', message: (_err, field) => {message} }}" ); } }