I am trying to localize MudBlazor data grid using resource files. But data grid filter items are still shown in English.
According to this I have added the following class:
using Microsoft.Extensions.Localization;
using MudBlazor;
internal class ResXMudLocalizer : MudLocalizer
{
private IStringLocalizer _localization;
public ResXMudLocalizer(IStringLocalizer<MudResources> localizer)
{
_localization = localizer;
}
public override LocalizedString this[string key] => _localization[key];
}
And added the following to Program.cs
builder.Services.AddTransient<MudLocalizer, ResXMudLocalizer>();
I have made sure that the CurrentUICulture is "fa-IR". I have made two Resx files named 'MudResources.resx' and 'MudResources.fa-IR.resx' and put localized strings in them.
But the data grid is still showing English words.
Am I doing something wrong or missing something?