매우 추하게 될 것입니다.
public class User
{
[Required(ErrorMessageResourceName = "Validation_Required", ErrorMessageResourceType = typeof(ModelTranslations))]
public int Id { get; set; }
[Required(ErrorMessageResourceName = "Validation_Required", ErrorMessageResourceType = typeof(ModelTranslations))]
[StringLength(40, ErrorMessageResourceName = "Validation_StringLength", ErrorMessageResourceType = typeof(ModelTranslations))]
public string FirstName { get; set; }
[Required(ErrorMessageResourceName = "Validation_Required", ErrorMessageResourceType = typeof(ModelTranslations))]
[StringLength(40, ErrorMessageResourceName = "Validation_StringLength", ErrorMessageResourceType = typeof(ModelTranslations))]
public string LastName { get; set; }
}
내가 내 블로그에서 예쁜 솔루션을 가지고 :
http://blog.gauffin.org/2010/11/simplified-localization-for-dataannotations/
참조 또한이 게시물 : http://stackoverflow.com/questions/3758512/localize-data-annotations-default-messages-required-stringlength -기타 –