title: How to provide localized validation messages for validation attributes
body: <p>I am working on an <a href="https://en.wikipedia.org/wiki/ASP.NET_Core" rel="nofollow noreferrer">ASP.NET Core</a> application and I would like to override the default validation error messages for data-annotations, like <code>Required</code>, <code>MinLength</code>, <code>MaxLength</code>, etc. I read the documentation at <em><a href="https://docs.microsoft.com/en-us/aspnet/core/fundamentals/localization" rel="nofollow noreferrer">Globalization and localization in ASP.NET Core</a></em>, and it seems that it does not cover what I was looking for...</p>
  <p>For instance, a validation error message for the <code>Required</code> attribute can always be the same for any model property. The default text just states: <em>The {0} field is required</em>, whereby the <code>{0}</code> placeholder will be filled up with the property’s display name.</p>
  <p>In my view models, I use the <code>Required</code> attribute without any named arguments, like this...</p>
  <pre><code>class ViewModel
  {
      [Required, MinLength(10)]
      public string RequiredProperty { get; set; }
  }
  </code></pre>
  <p>Setting an <code>ErrorMessage</code> or <code>ErrorMessageResourceName</code> (and <code>ErrorMessageResourceType</code>) is unnecessary overhead, in my opinion. I thought I could implement something similar to <code>IDisplayMetadataProvider</code> allowing me to return error messages for applied attributes, in case the validation has failed. Is this possible?</p>