code: public static LogEvent translate(LogEvent logEvent, String translatedMessage)
      {
          if (translatedMessage != null) {
              MessageParser parser = new MessageParser(translatedMessage, true);
  
              Object[] defaultArguments = logEvent.getArgumentArray();
              Object[] arguments = new Object[defaultArguments.length];
              StringBuilder message = new StringBuilder();
  
              int index = 0;
              for (MessageElement element = parser.next(); element != null; element = parser.next()) {
                  if (element instanceof MessageIndex) {
                      message.append(MessageParser.ARGUMENT_STR);
                      arguments[index++] = defaultArguments[((MessageIndex) element).getIndex()];
                  } else {
                      message.append(element.getString());
                  }
              }
  
              for (; index < arguments.length; ++index) {
                  arguments[index] = defaultArguments[index];
              }
  
              return new LogEvent(logEvent.getMarker(), logEvent.getLevel(), message.toString(), arguments,
                  logEvent.getThrowable(), logEvent.getTimeStamp());
          }
  
          return logEvent;
      }
docs: Translate the passed {@link LogEvent} based on the passed translation message pattern.
  <p>
  The translation message pattern use the same syntax than standard message pattern except that it's optionally
  possible to provide a custom index as in <code>Some {1} translation {0} message</code> in order to modify the
  order of the argument which can be required depending on the language.
  
  @param logEvent the {@link LogEvent} to translate
  @param translatedMessage the translated version of the {@link LogEvent} message
  @return the translated version of the passed {@link LogEvent}