Code example for ResourceBundle

Methods: getObject

0
				// ignore, bundle is already set to English 
			} 
		} 
		Object obj;
		try { 
			obj = bundle.getObject(message);
		} catch (MissingResourceException mre) {
			try { 
				obj = bundleEn.getObject(message);
			} catch (MissingResourceException mre2) {
				obj = message; // still can't find, use kay as translation
			} 
		} 
		if (null != obj && obj instanceof String) {
			return (String) obj;
		} 
		return message; // fallback when no translation
	} 
 
	/** 
	 * Get message using the default locale.