Я перевожу свой сайт с английского sh на французский. На данный момент все идет хорошо, за исключением перевода в раздел идентичности сайта. В настоящее время я пытаюсь перевести часть входа на сайт. Я использую ASP. NET Core 2.2 Имя файла est: namespace cae.website.Areas.Identity.Pages.Account
public class InputModel
{
[ExRequired]
[EmailAddress]
[Display(Name = "Email", Prompt = "example@outlook.com")]
public string Email { get; set; }
[ExRequired]
[DataType(DataType.Password)]
[Display(Name = "Password", Prompt = "******")]
public string Password { get; set; }
[Display(Name = "Remember me?")]
public bool RememberMe { get; set; }
}
public void ConfigureServices(IServiceCollection services)
{
services.AddLocalization(opts =>
{
opts.ResourcesPath = "Resources";
});
services.Configure<RequestLocalizationOptions>(opts =>
{
var supportedCultures = new List<CultureInfo>
{
new CultureInfo("en"),
new CultureInfo("fr")
};
opts.DefaultRequestCulture = new RequestCulture("en");
// Formating numbers, dates, etc.
opts.SupportedCultures = supportedCultures;
// UI strings that we have localized
opts.SupportedUICultures = supportedCultures;
});
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env, IServiceProvider serviceProvider)
{
var options = app.ApplicationServices.GetService<IOptions<RequestLocalizationOptions>>();
app.UseRequestLocalization(options.Value);
}
У меня есть папка Resource, куда я помещаю свой файл .resx но перевод не сделан. Чего мне не хватает, чтобы заставить его работать? Я не нашел много на net.
