Interface NlsTemplate


  • public interface NlsTemplate
    This interface represents the template for an internationalized text that can be translated to a given Locale.
    See Also:
    NlsMessage, NlsTemplateImpl
    • Method Detail

      • translate

        String translate​(Locale locale)
        This method translates the represented string for the given locale.
        This typically happens via a lookup in a ResourceBundle).
        Parameters:
        locale - is the locale to translate to.
        Returns:
        the resolved string (closest translation for the given locale).
      • translate

        boolean translate​(Locale locale,
                          NlsArguments arguments,
                          Appendable buffer)
        This method behaves like translate(Locale) but additionally fills the given arguments into the translated message writing into the given buffer.
        Parameters:
        locale - is the locale to translate to.
        arguments - are the dynamic NlsArguments to fill into the message.
        buffer - is the buffer where the translation will be appended to.
        Returns:
        true if the (translated) message has been appended to the given messageBuffer or false if the translation failed.