title: Spring, Thymeleaf and localized strings
body: <p>I am new to using Spring and Thymeleaf and I can't figure out where to put my localization .properties files. I have this Bean:</p>
  
  <pre><code>@Bean
  public MessageSource messageSource() {
  
      ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
      messageSource.setBasenames("classpath:messages/messages", "classpath:messages/validation");
      // if true, the key of the message will be displayed if the key is not
      // found, instead of throwing a NoSuchMessageException
      messageSource.setUseCodeAsDefaultMessage(false);
      messageSource.setDefaultEncoding("UTF-8");
      // # -1 : never reload, 0 always reload
      messageSource.setCacheSeconds(0);
  
      return messageSource;
  }
  </code></pre>
  
  <p>Inside login.html:</p>
  
  <pre><code>    &lt;p th:text="#{messages.hello}"&gt;Welcome to our site!&lt;/p&gt;
  </code></pre>
  
  <p>Inside <code>messages_en.properties</code> :</p>
  
  <pre><code>    messages.hello=Apparently messages work
  </code></pre>
  
  <p>My project structure:</p>
  
  <p><img src="https://i.stack.imgur.com/01Q14.png" alt="structure" title="structure"></p>
  
  <p>I have tried creating a folder inside WEB-INF called messages but apparently I am not getting something right. Any ideas?</p>
  
  <p>Edit: Updated question with code relevant to mesages.</p>