code: 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;
      }
docs: 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.
  
  @param tc
  the non-null <code>TraceComponent</code> of the message
  @param locales
  the possible locales to use for translation. Locales from the
  front of the list are preferred over Locales from the back of
  the list. If the list is null or empty, the default Locale
  will be used.
  @param msgKey
  the message key identifying an NLS message for this event.
  This message must be in the resource bundle currently
  associated with the <code>TraceComponent</code>.
  @param objs
  a number of <code>Objects</code> to include as substitution
  text in the message. The number of objects passed must equal
  the number of substitution parameters the message expects.
  Null is tolerated.
  @return
  the translated message