So far I have been able to translate everything in an ASP.Net Core 2.1 Web Application.
It has proven a little challenge, since the scaffolded Account Pages needed a
These error messages are generated using IdentityErrorDescriber. Here's a sample of what the class itself looks like:
public class IdentityErrorDescriber
{
...
public virtual IdentityError PasswordTooShort(int length)
{
return new IdentityError
{
Code = nameof(PasswordTooShort),
Description = Resources.FormatPasswordTooShort(length)
};
}
...
}
To customise a specific message, create your own IdentityErrorDescriber implementation. Here's an example:
public class MyIdentityErrorDescriber : IdentityErrorDescriber
{
public override IdentityError PasswordTooShort(int length)
{
return new IdentityError
{
Code = nameof(PasswordTooShort),
Description = "Your description goes here."
};
}
}
To use this new implementation, add it to the DI container in Startup.ConfigureServices:
services.AddScoped();