Code example for ResourceBundle

Methods: getLocalegetString

0
		this.bundleName = bundleName;
	} 
	 
	public String getString(String key) {
		try { 
			return internalBundle.getString(key.replaceAll(" ", "_"));
		} catch (Exception e) {
			System.err.printf("Key %s not found in bundle %s with locale %s %n", key, bundleName, internalBundle.getLocale());
			return key;
		} 
	} 
	 
	public String getComplexString(String key, Object[] messageArguments) {
		return new MessageFormat(getString(key)).format(messageArguments);
	} 
} 
Stop searching for code, let great code find you!  Add Codota to your java IDE