Interface Localizable

    • Method Detail

      • getMessage

        default String getMessage()
        ATTENTION:
        In most cases you wand to use getLocalizedMessage(Locale) instead of this method.
        Returns:
        the untranslated message with arguments filled in. This results in the message in its original language that should typically be English.
        See Also:
        getLocalizedMessage()
      • getLocalizedMessage

        default String getLocalizedMessage​(Locale locale)
        This method gets the resolved and localized message.
        Parameters:
        locale - is the locale to translate to.
        Returns:
        the localized message.
      • getArgument

        default Object getArgument​(String key)
        This method gets the language independent argument value for the given key.
        Parameters:
        key - is the name of the requested argument.
        Returns:
        the argument value for the given key or null if NOT defined.
      • ofStatic

        static Localizable ofStatic​(String message)
        Parameters:
        message - the message.
        Returns:
        a dummy implementation of Localizable for the given message that does not support localization and simply ignores any given Locale.
      • createBundleName

        static String createBundleName​(Class<?> type)
        Parameters:
        type - the Class reflecting the context of the localization (e.g. Enum or NlsMessage).
        Returns:
        the derived bundle name for the given Class.