title: plugin.properties mechanism in eclipse RCP
body: <p>My project includes multiple plugins and every plugin includes the plugin.properties file with near to 20 translations.
  The MANIFEST.MF file defines the name of the properties files where the external plugin strings are stored.</p>
  
  <pre><code>Bundle-Localization: plugin
  </code></pre>
  
  <p>The name of the plugin i define like</p>
  
  <pre><code>%plugin.name
  </code></pre>
  
  <p>Eclipse will search the "%plugin.name" in the plugin.properties file at runtime.</p>
  
  <p>Which class read out the MANIFEST.MF Bundle-Localization entry and at which point is the string with the starting '%' suffix is searched in the "plugin.properties" file?</p>
  
  <p>I want to find and patch these class in that way, that i can first look into some other directories/files for the "%plugin.name" identifier. With these new mechanism i can add fragments to my product and overwrite single lines in a "plugin.properties" file without changing the original plugin.
  With these mechanism i could create a build process for multiple customers just by adding different fragments. The fragments including the customer names and special string they want to change.</p>
  
  <p>I want to do it that way, because the fragment mechanism only add files to the original plugin. When the "plugin.properties" file is existing in the plugin, the fragment "plugin.properties" files are ignored.</p>
  
  <p><strong>UPDATE 1:</strong></p>
  
  <p>The method</p>
  
  <pre><code>class ManifestLocalization{
  ...
  protected ResourceBundle getResourceBundle(String localeString) {
  }
  ...
  }
  </code></pre>
  
  <p>returns the ResourceBundle of the properties file  for the given locale string.
  When somebody nows how i can now first look into the fragment to get the resource path please post it.</p>
  
  <p><strong>UPDATE 2:</strong></p>
  
  <p>The method in class ManifestLocalization</p>
  
  <pre><code>    private URL findInResolved(String filePath, AbstractBundle bundleHost) {
  
          URL result = findInBundle(filePath, bundleHost);
          if (result != null)
              return result;
          return findInFragments(filePath, bundleHost);
      }
  </code></pre>
  
  <p>Searchs for the properties file and cache it. The translations can than get from the cached file. The problem is, that the complete file is cached and not single translations.</p>
  
  <p>A solution would be to first read the fragment file, than read the bundle file. When both files are existing merge them into one file and write the new properties file to the disk. The URL of the new properties file returns, so that the new propetries file can cached.</p>