public static final String formatMessage ( TraceComponent tc , List < Locale > locales , String msgKey , Object ... objs ) { // WsLogRecord.createWsLogRecord + BaseTraceService.formatMessage // The best odds for finding the resource bundle are with using the // classloader that loaded the associated class to begin with. Start // there. ResourceBundle rb ; String msg ; try { rb = TraceNLSResolver . getInstance ( ) . getResourceBundle ( tc . getTraceClass ( ) , tc . getResourceBundleName ( ) , locales ) ; msg = rb . getString ( msgKey ) ; } catch ( Exception ex ) { // no FFDC required msg = msgKey ; } if ( msg . contains ( "{0" ) ) { return MessageFormat . format ( msg , objs ) ; } return msg ; }
Translate a message in the context of the input trace component . This method is typically used to provide translated messages that might help resolve an exception that is surfaced to a user .