I have both English and Spanish version of the website. Is there a way to have the validation message appear in Spanish when on the Spanish Version?
I have altered the RegisterViewModel
public class RegisterViewModel
{
[Required(ErrorMessageResourceType = typeof(Registration), ErrorMessageResourceName = "FirstNameRequired")]
[Display(Name = "FirstName", ResourceType = typeof(Registration))]
[StringLength(30, ErrorMessageResourceType = typeof(Registration), ErrorMessageResourceName = "FirstNameLength")]
public string FirstName { get; set; }
[Required(ErrorMessageResourceType = typeof(Registration), ErrorMessageResourceName = "LastNameRequired")]
[Display(Name = "LastName", ResourceType = typeof(Registration))]
[StringLength(50, ErrorMessageResourceType = typeof(Registration), ErrorMessageResourceName = "LastNameLength")]
public string LastName { get; set; }
[Required(ErrorMessageResourceType = typeof(Registration), ErrorMessageResourceName = "EmailRequired")]
[EmailAddress]
[Display(Name = "Email", ResourceType = typeof(Registration))]
public string Email { get; set; }
[StringLength(100, ErrorMessageResourceType = typeof(Registration), ErrorMessageResourceName = "PasswordMinimum", MinimumLength = 8)]
[DataType(DataType.Password)]
[Display(Name = "Password", ResourceType = typeof(Registration))]
[Required(ErrorMessageResourceType = typeof(Registration), ErrorMessageResourceName = "PasswordRequired")]
public string Password { get; set; }
[DataType(DataType.Password)]
[Display(Name = "PasswordConfirm", ResourceType = typeof(Registration))]
[Required(ErrorMessageResourceType = typeof(Registration), ErrorMessageResourceName = "PasswordConfirmRequired")]
[Compare("Password", ErrorMessageResourceType = typeof(Registration), ErrorMessageResourceName = "Compare")]
public string ConfirmPassword { get; set; }
[Display(Name = "Telephone", ResourceType = typeof(Registration)), Phone]
[Required(ErrorMessageResourceType = typeof(Registration), ErrorMessageResourceName = "TelephoneRequired")]
[DataType(DataType.PhoneNumber)]
public string PhoneNumber { get; set; }
public string CaptchaCode { get; set; }
}
but don't know how to change the message when it is missing a requirement such as
Passwords must have at least one uppercase ('A'-'Z')