0

I apologize for the possible incorrectness of the translation (I use a translator).

I have been trying for a long time to solve the problem of localization and globalization in Blazor Server.

I have had successful localization experience in ASP.NET MVC and successfully localized the application on Blazor Server. But I have problems when trying to localize the models. in MVC, it works like this, we create a resource file with a localization suffix (Employee.en-US.resx) and specify in the pipeline

builder.Services.AddMvc()`
.AddViewLocalization(LanguageViewLocationExpanderFormat.Suffix)
.AddDataAnnotationsLocalization();

In Blazor Server, I added application localization by

var supportedCultures = new[] { "en-US", "ru-RU", "uk-UA", "de-DE" };
var localizationOptions = new RequestLocalizationOptions().SetDefaultCulture(supportedCultures[0])
.AddSupportedCultures(supportedCultures)
.AddSupportedUICultures(supportedCultures);

But when I try to work with models, they don't connect to me. Who has had experience with this?

0 Answers0