title: Load ResourceBundle depending on context
body: <p>I have an application that is separated in several contexts with the same layout for each context but with different messages.</p>
  
  <p>Example on context "A":</p>
  
  <blockquote>
    <p>TITLE </p>
    
    <p>Label: text</p>
  </blockquote>
  
  <p>Example on context "B":</p>
  
  <blockquote>
    <p>TITLE B</p>
    
    <p>Label: text B</p>
  </blockquote>
  
  <p>Note that the "Label" is the same on each context and context "A" is the default context.</p>
  
  <p>I need to have one properties files per context:</p>
  
  <ul>
  <li>resources.properties (context A - default)</li>
  </ul>
  
  <blockquote>
    <p>title=TITLE </p>
    
    <p>label=Label </p>
    
    <p>text=text</p>
  </blockquote>
  
  <ul>
  <li>resources_b.properties (context B)</li>
  </ul>
  
  <blockquote>
    <p>title=TITLE B</p>
    
    <p>text=text B</p>
  </blockquote>
  
  <p>And I would like to load the good property file depending on context.</p>
  
  <p>The first solution I found is to use <code>Locale</code> like this:</p>
  
  <pre><code>// context is either "A", "B"...
  resources = ResourceBundle.getBundle(config, new Locale(context));
  </code></pre>
  
  <p>This way, if the message is not found in <em>resources_b.properties</em>, it will return the one from <em>resources.properties</em> as expected.</p>
  
  <p>What could be the best way to have a "pretty" resource loading per context not using <code>Locale</code> ?</p>
  
  <p>The application is currently only in English, but it may change in the future...</p>