List of usage examples for java.text MessageFormat setLocale
public void setLocale(Locale locale)
From source file:ResourceBundleSupport.java
/** * Formats the message stored in the resource bundle (using a * MessageFormat).//from w w w . j a v a2 s. c om * * @param key the resourcebundle key * @param parameters the parameter collection for the message * @return the formated string */ public String formatMessage(final String key, final Object[] parameters) { final MessageFormat format = new MessageFormat(getString(key)); format.setLocale(getLocale()); return format.format(parameters); }