0
stjepanh_teched created
- ABP Framework version: v4.4.2.
- UI type: Blazor
- DB provider: EF Core
Hello, we are trying to localize the deafult messages from data annotation validation attributes on the client side. Using Blazorise validation works, but we've opted to use Blazor form elements. Is it possible to make localization work in that context? Basic example:
Component.razor:
<EditForm Model="model" OnValidSubmit="SubmitAsync">
<DataAnnotationsValidator />
<InputText id="name" @bind-Value="model.Test" />
<ValidationMessage For="() => model.Test" />
<Button Type="ButtonType.Submit">Button</Button>
</EditForm>
Model DTO:
public class TestDto
{
[Required(ErrorMessage = "Required1"]
public string Test { get; set; }
}
We've added key-value pair in en.json: "Required1": "test test {0}"
Thank you in advance
1 Answer(s)
-
-1
Hi,
This is a feature of blazorise, you should keep use blazorise element.