title: Image i18n in JSF2
body: <p>I am trying to localize images in JSF, and I want the user to be able to set their locale on my site.  This I am doing by a call to</p>
  
  <pre><code>FacesContext.getCurrentInstance().getViewRoot().setLocale(_locale);
  </code></pre>
  
  <p>which works great, with one exception:</p>
  
  <pre><code>&lt;h:graphicImage library="images" name="pic.gif" /&gt;
  </code></pre>
  
  <p>uses the <code>Accept-Language</code> sent in the browser's request to determine which locale to use.  I can work around this by placing a locale string in each <code>.properties</code> file and referencing images by</p>
  
  <pre><code>&lt;h:graphicImage library="#{resource.locale}/images" name="pic.gif" /&gt;
  </code></pre>
  
  <p>but then there is no fall-back for individual images, so I have to have a copy of every image, whether it is different or not, in every locale's directory.  This is quite cumbersome, given that I support 9 locales and probably more in the future.  Any advice would be much appreciated.</p>