Package org.daisy.dotify.api.translator
Class Translatable
- java.lang.Object
-
- org.daisy.dotify.api.translator.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Translatable.Builder
Provides a builder for translatable objects.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description TextAttribute
getAttributes()
Gets the text attributes for the text.String
getLocale()
Gets the locale for the text.String
getText()
Gets the text.Boolean
isHyphenating()
Returns true if the text should be hyphenated.boolean
shouldMarkCapitalLetters()
Returns true if the text should mark capital letters.static Translatable.Builder
text(String text)
Creates a new Translatable.Builder with the specified text.
-
-
-
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
-
-