title: FluentValidation custom message localization not working with When() condition
body: <p>I am localizing a site with fluent validation and resource files and everything is working fine, except that when I try to set up a custom error using a validation <code>&quot;When()&quot;</code> condition.</p>
  <p>In the following example:</p>
  <pre><code>public class InstructionValidator : AbstractValidator&lt;InstructionModel&gt;
  {
      public InstructionValidator()
      {
          RuleFor(x =&gt; x.Name)
              .Length(0, 50)
              .WithMessage(Resources.InvalidError);
          RuleFor(x =&gt; x.Revision)
              .NotNull()
              .InclusiveBetween(1, int.MaxValue)
              .WithMessage(Resources.InvalidError);
          RuleFor(x =&gt; x.RevisionDate)
              .NotNull()
              .When(x =&gt; x.Revision &gt; 1)
              .WithMessage(Resources.RevisionDateRequiredError);
      }
  }
  </code></pre>
  <p>the first two rules (for Name and Revision) work fine and show either English or Spanish messages based on whatever culture the user has picked.</p>
  <p>However, the third rule, with the <code>&quot;when&quot;</code> condition, will always show the English message.</p>
  <p>I have checked all the other rules in use on the site, and it is consistent - everyone works showing English or Spanish based on the culture set, except when a <code>&quot;when&quot;</code> condition is used, then it's always English.</p>
  <p>Maybe this has something to do with the <code>&quot;when&quot;</code> being a server vs client check?  I did try playing around with <code>&quot;WithLocalizedMessage()&quot;</code> instead of <code>&quot;WithMessage()&quot;</code>, and setting the <code>ValidatorOptions.ResourceProviderType</code>, but still couldn't get it to work probably.</p>