public static String formatMessageInternal(String loaderKey, String key, Object... arguments) { ResourceLoader loader = getLoader(loaderKey); String format = (String) loader.get(key); return MessageFormat.format(format, arguments); }
/** ** Return formatted message based on locale-specific pattern ** ** @param key maps to locale-specific pattern in properties file ** @param args parameters to format and insert according to above pattern ** @return formatted message ** ** @author Sugiura, Tatsuki (University of Nagoya) ** @author Jean-Francois Leveque (Universite Pierre et Marie Curie - Paris 6) ** **/ public String getFormattedMessage(String key, Object... args) { if ( getLocale().toString().equals(DEBUG_LOCALE) ) return formatDebugPropertiesString( key ); String pattern = (String) get(key); if (log.isDebugEnabled()) { log.debug("getFormattedMessage(key,args) bundle name=" + this.baseName + ", locale=" + getLocale().toString() + ", key=" + key + ", pattern=" + pattern); } return (new MessageFormat(pattern, getLocale())).format(args, new StringBuffer(), null).toString(); }
public static String getMessage(String loaderKey, String key) { ResourceLoader loader = getLoader(loaderKey); return (String) loader.get(key); }