title: How to display messages in Thymeleaf and Spring Boot?
body: <p>I created a Spring Boot web application that uses Thymeleaf as the template engine. I configured the <code>MessageSource</code> to look for messages in a subfolder:</p>
  
  <pre><code>@Bean
  public MessageSource messageSource() {
      final ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
  
      messageSource.setBasename("i18n/messages");
      messageSource.setFallbackToSystemLocale(false);
      messageSource.setCacheSeconds(0);
  
      return messageSource;
  }
  </code></pre>
  
  <p>In this folder I created the file <code>messages_de.properties</code> with the content <code>ticket.type.BUG=Fehler</code>. In my template I try to display the text like this:</p>
  
  <pre><code>&lt;p th:text="#{ticket.type.BUG}"&gt;BUG&lt;/p&gt;
  </code></pre>
  
  <p>But when the page is rendered, I get the following:</p>
  
  <pre><code>&lt;p&gt;??ticket.type.BUG_de_DE??&lt;/p&gt;
  </code></pre>
  
  <p>What am I missing? Do I have to configure any additional beans?</p>
  
  <p><strong>P.S.:</strong></p>
  
  <p>On the 'server side' I am able to obtain the message using <code>MessageSource#getMessage("ticket.type.BUG", null, Locale.GERMANY)</code>.</p>