A2uiMessageFormatter


public fun interface A2uiMessageFormatter


Interface to format messages with arguments using the ICU MessageFormat syntax.

The implementation of this interface should be provided by the platform (e.g., using android.icu.text.MessageFormat or com.ibm.icu.text.MessageFormat).

Summary

Public methods

abstract @NonNull String
format(
    @NonNull String pattern,
    @NonNull Locale locale,
    @NonNull Map<@NonNull String, @NonNull Object> arguments
)

Formats the specified pattern using the given locale and arguments.

Public methods

format

abstract @NonNull String format(
    @NonNull String pattern,
    @NonNull Locale locale,
    @NonNull Map<@NonNull String, @NonNull Object> arguments
)

Formats the specified pattern using the given locale and arguments.

Implementations should ignore extra keys in arguments that are not present in the pattern. If a key required by the pattern is missing from arguments, the implementation should throw an exception.

Parameters
@NonNull String pattern

the message format pattern in ICU MessageFormat syntax

@NonNull Locale locale

the locale to use for formatting

@NonNull Map<@NonNull String, @NonNull Object> arguments

the map of arguments to replace in the pattern

Returns
@NonNull String

the formatted string