Class MessageTranslator<D>

All Implemented Interfaces:
MessageReceiver<SimpleMessage<D>>

public class MessageTranslator<D> extends MessagePasser<SimpleMessage<D>>
Translates the text (and possibly some arguments) of a SimpleMessage.args into another (human) language. Then String.format(String,Object[]) is applied to the result and the arguments. If a MessageFormatter.Formandum is found in the arguments, the same process is applied an its result used as an argument.
  • Field Details

  • Constructor Details

    • MessageTranslator

      public MessageTranslator()
    • MessageTranslator

      public MessageTranslator(MessageReceiver<SimpleMessage<D>> rec, CatalogByString catalog, String... langs)
      Constructor which sets all parameters.
      Parameters:
      rec - drain to which messages will be sent,
      catalog - of translations
      langs - language preferences
    • MessageTranslator

      public MessageTranslator(MessageReceiver<SimpleMessage<D>> rec, CatalogByString catalog, List<String> langs)
      Constructor which sets all parameters.
      Parameters:
      rec - drain to which messages will be sent,
      catalog - of translations
      langs - language preferences
  • Method Details