0
arodriguez created
Greetings, I am using the following regular expression:
[RegularExpression(@"^[a-zA-Z0-9]+$", ErrorMessage ="El código solo puede contener letras y Números")]
I need the error message to be customized and related to a tag used within the Json files of the Localization For example something like this:
[RegularExpression(@"^[a-zA-Z0-9]+$", ErrorMessageResourceName ="CodeMessage")] // CodeMessage is my Generic Tag into es.json and en.json (both located in the localization folder)
- ABP Framework version: v4.4.2
- UI type: Blazor
- DB provider: Sql Server
1 Answer(s)
-
0
Hi, can you configure the
AbpMvcDataAnnotationsLocalizationOptions
in your module class as below:[DependsOn( //modules... )] public class MyBlazorModule : AbpModule { public override void PreConfigureServices(ServiceConfigurationContext context) { context.Services.PreConfigure<AbpMvcDataAnnotationsLocalizationOptions>(options => { options.AddAssemblyResource(typeof(MyResource), typeof(MyBlazorModule).Assembly); }); } }
Then you should be able to get the error messages as localized.