Package com.persequor.extension.frontend
Class I18nText
java.lang.Object
com.persequor.extension.frontend.I18nText
- All Implemented Interfaces:
IString
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionboolean
getText()
getType()
int
hashCode()
static Text
Example: Text.join(" ", "500", "elephants", "ran", "across", "the", "savanna"); produces 500 elephants ran across the savanna.static Text
Example: Text.join(" ", "500", "elephants", "ran", "across", "the", "savanna"); produces 500 elephants ran across the savanna.static I18nText
In order to support translation of variable text, add the variable part of your text as tokens.toMap
(Collection<String> keys) toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.persequor.extension.frontend.IString
getTextWithTokens
-
Field Details
-
NULL_TEXT
-
-
Method Details
-
toMap
- Parameters:
keys
- collection of Strings to be used as keys of the map- Returns:
- a Map with translatable texts as the values
-
of
In order to support translation of variable text, add the variable part of your text as tokens.Example:
I18nText.of("{{1}} {{2}} ran across the {{3}}", "500", "elephants", "savanna");
produces500 elephants ran across the savanna
Note: If you want the tokens to be translatable, pass them asI18nText
.- Parameters:
text
- Text to be showntokens
- tokens to replace into the text/translated text- Returns:
- Object representing translatable text
-
join
Example: Text.join(" ", "500", "elephants", "ran", "across", "the", "savanna"); produces 500 elephants ran across the savanna. All the tokens will be translatable
Note: If you want the tokens to not be translatable, useText.join(String, Object...)
.- Parameters:
delimiter
- Delimiter to use between tokenstokens
- tokens to join- Returns:
- Object representing text
-
join
Example: Text.join(" ", "500", "elephants", "ran", "across", "the", "savanna"); produces 500 elephants ran across the savanna. All the tokens will be translatable
Note: If you want the tokens to not be translatable, useText.join(String, Object...)
.- Parameters:
delimiter
- Delimiter to use between tokenstokens
- tokens to join- Returns:
- Object representing text
-
getText
-
getTokens
-
getType
-
equals
-
hashCode
public int hashCode() -
toString
-