Package com.persequor.extension.frontend
Class I18nText
java.lang.Object
com.persequor.extension.frontend.I18nText
- All Implemented Interfaces:
IString
IString
implementation for translatable text.-
Nested Class Summary
Nested classes/interfaces inherited from interface com.persequor.extension.frontend.IString
IString.IStringList
-
Method Summary
Modifier and TypeMethodDescriptionboolean
getText()
getType()
int
hashCode()
static I18nText
static I18nText
Create a translatable string where the tokens are translatable individually.static I18nText
In order to support translation of variable text, add the variable part of your text as (non-translatable) replacement tokens.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.persequor.extension.frontend.IString
getTextWithTokens
-
Method Details
-
of
In order to support translation of variable text, add the variable part of your text as (non-translatable) replacement tokens.Example:
I18nText.of("{{1}} {{2}} ran across the {{3}}", "500", "elephants", "savanna");
produces500 elephants ran across the savanna
If you need to translate the tokens also, see
of(String,IString...)
.- Parameters:
text
- Text to be showntokens
- tokens to replace into the text/translated text- Returns:
- Object representing translatable text
-
of
Create a translatable string where the tokens are translatable individually.Example:
I18nText.of("{{1}} {{2}} ran across the {{3}}", Text.of("500"), I18nText.of("elephants"), I18nText.of("savanna");
produces500 elephants ran across the savanna
, where everything except500
will be translated.- Parameters:
text
- Text to be showntokens
- tokens to replace into the text/translated text- Returns:
- Object representing translatable text
-
of
- Parameters:
text
- to appear as a translated string- Returns:
- Object representing translatable text
-
getText
-
getTokens
-
getType
-
equals
-
hashCode
public int hashCode()
-