Class AiMessageListI18n

java.lang.Object
io.jmix.aichat.component.messagelist.AiMessageListI18n
All Implemented Interfaces:
Serializable

public class AiMessageListI18n extends Object implements Serializable
Internationalization holder for AiMessageList: the error banner message, the retry button label, the scroll-to-bottom button's accessible label, the built-in copy action's accessible name and post-copy announcement, and the collapse-toggle labels for long user messages. Set once on the list; not per message.

The labels of the code blocks rendered inside assistant messages are the code block's own AiCodeBlockI18n, nested here rather than restated: the list's localization mirrors the component tree it renders, so a field added to the code block's holder reaches the list without a change here.

The escalating "thinking" labels are not here: each is paired with a non-localizable delay, so they are list-level behavior configuration on AiMessageList.setThinkingStages(java.util.List<io.jmix.aichat.component.messagelist.ThinkingStage>) instead.

See Also:
  • Constructor Details

    • AiMessageListI18n

      public AiMessageListI18n()
  • Method Details

    • fromMessages

      public static AiMessageListI18n fromMessages(Messages messages)
      Creates an instance with all fields resolved from the message bundle (aiMessageList.i18n.*), including the nested code-block holder from its own keys.
      Parameters:
      messages - the messages bean
      Returns:
      a new localized instance
    • getError

      public @Nullable String getError()
      Returns:
      the error banner message
    • setError

      public AiMessageListI18n setError(@Nullable String error)
      Parameters:
      error - the error banner message
      Returns:
      this instance for chaining
    • getRetry

      public @Nullable String getRetry()
      Returns:
      the retry button label
    • setRetry

      public AiMessageListI18n setRetry(@Nullable String retry)
      Parameters:
      retry - the retry button label
      Returns:
      this instance for chaining
    • getScrollToBottom

      public @Nullable String getScrollToBottom()
      Returns:
      the accessible label for the scroll-to-bottom button
    • setScrollToBottom

      public AiMessageListI18n setScrollToBottom(@Nullable String scrollToBottom)
      Parameters:
      scrollToBottom - the accessible label for the scroll-to-bottom button
      Returns:
      this instance for chaining
    • getCopy

      public @Nullable String getCopy()
      Returns:
      the accessible name (and tooltip) of the built-in copy action's button
    • setCopy

      public AiMessageListI18n setCopy(@Nullable String copy)
      Parameters:
      copy - the accessible name (and tooltip) of the built-in copy action's button
      Returns:
      this instance for chaining
    • getCopied

      public @Nullable String getCopied()
      Returns:
      the label announced to assistive technologies after the built-in copy action has copied the message
    • setCopied

      public AiMessageListI18n setCopied(@Nullable String copied)
      Parameters:
      copied - the label announced to assistive technologies after the built-in copy action has copied the message
      Returns:
      this instance for chaining
    • getShowMore

      public @Nullable String getShowMore()
      Returns:
      the label of the collapse toggle when the message is collapsed
    • setShowMore

      public AiMessageListI18n setShowMore(@Nullable String showMore)
      Parameters:
      showMore - the label of the collapse toggle when the message is collapsed
      Returns:
      this instance for chaining
    • getShowLess

      public @Nullable String getShowLess()
      Returns:
      the label of the collapse toggle when the message is expanded
    • setShowLess

      public AiMessageListI18n setShowLess(@Nullable String showLess)
      Parameters:
      showLess - the label of the collapse toggle when the message is expanded
      Returns:
      this instance for chaining
    • getCodeBlock

      public @Nullable AiCodeBlockI18n getCodeBlock()
      Returns:
      the localization of the code blocks rendered inside messages, or null
    • setCodeBlock

      public AiMessageListI18n setCodeBlock(@Nullable AiCodeBlockI18n codeBlock)
      Sets the localization of the code blocks rendered inside messages. The client threads it onto every <jmix-ai-code-block> it renders.
      Parameters:
      codeBlock - the code-block localization, or null
      Returns:
      this instance for chaining