Community
Participate
Working Groups
In RCP it is possible to define icons for commandImages, view, and perspectives using the syntax "$nl$/icons/myimage.png" to localize images. Using this mechanism in RAP always uses the system/osgi locale instead of the client side locale. Looking a bit deeper I found the code responsible for this in class "org.eclipse.core.internal.runtime.FindSupport" and static member "NL_JAR_VARIANTS". Since this is an equinox common plugin this seems to be not fixable there for RAP. A possible solution for RAP would be to change the Methode "org.eclipse.ui.plugin.AbstractUIPlugin.imageDescriptorFromPlugin(String, String)" to use the following code instead of "fullPathString = BundleUtility.find(bundle, imageFilePath)": New Code: Locale locale = RWT.getLocale(); HashMap<String, String> map = new HashMap<String, String>(); map.put("$nl$", locale.toString()); URL fullPathString = FileLocator.find(bundle, new Path(imageFilePath), map); if (fullPathString == null) { // look for the image (this will check both the plugin and fragment // folders fullPathString = BundleUtility.find(bundle, imageFilePath); if (fullPathString == null) { try { fullPathString = new URL(imageFilePath); } catch (MalformedURLException e) { return null; } } } return ImageDescriptor.createFromURL(fullPathString);