Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Globally configure MudBlazor validation messages for localization?

$
0
0

I'm working on a Blazor application using MudBlazor and need to localize validation messages (like "Required") globally across all components. Currently, I have to set the validation message for each input individually, which isn't maintainable.For example, I currently have to do this for each component:

<MudSelect T="int?" @bind-Value="_input.SaleTypeId"           RequiredError="@Localizer["Required"]"           Label="@Localizer["SelectSaleType"]"            Dense="true"            Required="true">    @foreach (var saleType in SaleTypes)    {        var id = (int?)saleType.Id;<MudSelectItem Value="@id">@saleType.Title</MudSelectItem>    }</MudSelect>

Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>