title: Internationalization (i18n) using JSF Facelets: Messages in Java-classes
body: <p>I have successfully implemented i18n in my project. Now I'm stuck in my Bean...</p>
  
  <pre><code>private String pageTitle;
  public List&lt;Product&gt; getProductsByCategory(String category) {
    if(validate(category)) {
      pageTitle = category;
      return service.getProductsByCategory(String category);
    } else {
      pageTitle = "Random products";
      return service.getRandomProducts();
    }
  }
  </code></pre>
  
  <p>As you can see, I would like to let my pageTitle depend on the result of the provided method. All fine, but this is not fine considering internationalization. I have tried using a Properties.load(new FileInputStream) approach, but this does not work considering the files are name base.properties, base_en_US.properties and so on.</p>
  
  <p>Does anyone know the best practice in this kind of situation? Thanks in advance!</p>