Class Translatable


  • public class Translatable
    extends Object

    Provides a specification for a text to translate. The text to translate is a simple string, optionally with style attributes associated with all and/or part of the text.

    This class has the following characteristics:

    • it applies to a single text string
    • style attributes apply to the whole text or to some part of it
    • there's no information about the context of the text to translate
    See Also:
    TranslatableWithContext
    • Method Detail

      • text

        public static Translatable.Builder text​(String text)
        Creates a new Translatable.Builder with the specified text.
        Parameters:
        text - the text to translate
        Returns:
        returns a new Translatable.Builder
      • getText

        public String getText()
        Gets the text.
        Returns:
        returns the text
      • getLocale

        public String getLocale()
        Gets the locale for the text.
        Returns:
        returns the locale
      • getAttributes

        public TextAttribute getAttributes()
        Gets the text attributes for the text.
        Returns:
        returns the text attributes for the text
      • isHyphenating

        public Boolean isHyphenating()
        Returns true if the text should be hyphenated.
        Returns:
        returns true if the text should be hyphenated, false otherwise
      • shouldMarkCapitalLetters

        public boolean shouldMarkCapitalLetters()
        Returns true if the text should mark capital letters.
        Returns:
        true if the capital letters should be marked, false otherwise