title: Using a custom ResourceBundle with Hibernate Validator
body: <p>I'm trying to set up a custom message source for Hibernate Validator 4.1 through Spring 3.0. I've set up the necessary configuration:</p>
  
  <pre><code>&lt;!-- JSR-303 --&gt;
  &lt;bean id="validator"
      class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean"&gt;
      &lt;property name="validationMessageSource" ref="messageSource"/&gt;
   &lt;/bean&gt;
  </code></pre>
  
  <p>The translations are served from my message source, but it seems that the replacement tokens in the messages themselves are looked up in the message source, i.e. for a:</p>
  
  <pre><code>my.message=the property {prop} is invalid
  </code></pre>
  
  <p>there are calls to look up 'prop' in the messageSource. Going into <a href="http://grepcode.com/file/repository.jboss.org/nexus/content/repositories/releases/org.hibernate/hibernate-validator/4.1.0.Beta1/org/hibernate/validator/engine/ResourceBundleMessageInterpolator.java#126"><code>ResourceBundleMessageInterpolator.interpolateMessage</code></a> I note that the javadoc states:</p>
  
  <blockquote>
    <p>Runs the message interpolation according to algorithm specified in JSR 303.</p>
    
    <p>Note:
    Look-ups in user bundles is recursive whereas look-ups in default bundle are not!</p>
  </blockquote>
  
  <p>This looks to me like the recursion will always take place for a user-specified bundle, so in effect I can not translate standard messages like the one for Size.</p>
  
  <p>How can I plug-in my own message source and be able to have parameters be replaced in the message?</p>