title: Load localized resources
body: <p>In a project I'm working on, I'd like to load different resources depending on the current locale. With strings, this is pretty easy: just create a resource bundle by adding some files, for example <code>Localization.properties</code> and <code>Localization_de.properties</code> and then load it via <code>ResourceBundle.getBundle("domain.project.Localization")</code>.</p>
  
  <p>But how do I load localized resources that are not simple strings?</p>
  
  <p>Specifically, I'd like to load images and HTML files based on locale. It would suffice to get the correct URL to that resource. For example, I'd like to have a <code>Welcome.html</code> and <code>Welcome_de.html</code> file and load the later when the current locale is German.</p>
  
  <p>Simply using <code>getClass().getResource("Welcome.html")</code> doesn't work, it's always returning exactly that file and doesn't do locale handling. I haven't found a convenient way to solve this yet, apart from manually messing with the filename based on the current locale.</p>
  
  <p>One solution I came up with is to add a key to my <code>Localization.properties</code> file that contains the name of the correct localized HTML file. But this feels hacky and wrong.</p>
  
  <p>Note that this is not an Android application, just a standard Java 8 desktop app.</p>