Ok, I have a weird one here. If my cookie is set to a non default language (i.e. french) it translates everything perfectly well when I first start the application, including data annotations.
However, if I change the language while the application is running, it will only switch the language on attributes using @Localizer["...."] but not the data annotations:
Notice that Organization Details has been changed, but not the field labels.
I must mention that this is .NET Core 2.0, and I'm using portable files (*.po) with OrchardCore as per ASP.NET Core Instructions in the documentation.
services.AddPortableObjectLocalization(options => options.ResourcesPath= "Localization");
services
.AddMvc()
.AddViewLocalization()
.AddDataAnnotationsLocalization()
.AddJsonOptions(options => options.SerializerSettings.ContractResolver = new DefaultContractResolver());
services.Configure<RequestLocalizationOptions>(options =>
{
var supportedCultures = new List<CultureInfo>
{
new CultureInfo("en"),
new CultureInfo("de"),
new CultureInfo("fr"),
new CultureInfo("it")
};
options.DefaultRequestCulture = new RequestCulture("en");
options.SupportedCultures = supportedCultures;
options.SupportedUICultures = supportedCultures;
});