My project includes several plugins, and each plugin includes a plugin.properties file with almost 20 translations. The MANIFEST.MF file defines the name of the property files in which the strings of the external plug-in are stored.
Bundle-Localization: plugin
I define the name of the plugin as
%plugin.name
Eclipse will look for "% plugin.name" in the plugin.properties file at runtime.
Which class reads the MANIFEST.MF Bundle-Localization record and at what point is the line with the initial suffix "%" in the file "plugin.properties" found?
I want to find and fix this class so that I can first examine some other directories / files for the identifier "% plugin.name". With this new mechanism, I can add fragments to my product and overwrite individual lines in the "plugin.properties" file without changing the original plugin. With this mechanism, I could create a build process for multiple clients by simply adding different fragments. Fragments, including customer names and a special line, that they want to change.
I want to do this because the fragment mechanism only adds files to the source plugin. When the "plugin.properties" file exists in the plugin, the files of the "plugin.properties" fragment are ignored.
UPDATE 1:
Method
class ManifestLocalization{ ... protected ResourceBundle getResourceBundle(String localeString) { } ... }
returns the ResourceBundle of the properties file for the given locale string. When someone tells me how I can first examine the fragment to get the path to the resource, send it.
UPDATE 2:
Method in class ManifestLocalization
private URL findInResolved(String filePath, AbstractBundle bundleHost) { URL result = findInBundle(filePath, bundleHost); if (result != null) return result; return findInFragments(filePath, bundleHost); }
Search for a properties file and cache it. Translation can be obtained from the cached file. The problem is that the full file is cached, not single translations.
The solution is to read the fragment file first than to read the package file. When both files exist, merge them into one file and write the new properties file to disk. The URL of the new properties file is returned so that the new proposition file can be cached.
java plugins rcp fragment
Markus lausberg
source share