* @param path The path to the bundle.
* @return The secure resource bundle.
* @throws IOException For errors finding or reading the passed URL.
*/
private SecureResourceBundle getResourceBundle(final String path) throws IOException {
SecureResourceBundle bundle = null;
URL url = getClass().getResource(path);
/* The following code was added by Alex Alishevskikh
* [alex@openmechanics.net] to fix for crashes on machines with
* unsupported user languages */
String modifiedPath = path;
if (url == null) {
/* if the given resource file not found, the english resource
* uses as default */
modifiedPath = path.substring(0, path.lastIndexOf(".")) + ".en";
url = getClass().getResource(modifiedPath);
}
final InputStream in = url.openStream();
bundle = new SecureResourceBundle(in);
return bundle;
}