@FunctionalInterface
public interface Translator
| Modifier and Type | Field and Description |
|---|---|
static BasicTranslator |
GLOBAL
The global translator that is used by default.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
translate(java.lang.String key)
Translate the given key.
Return null if the key is not found. |
default java.lang.String |
translateOrKey(java.lang.String key)
Translate the given key.
If the key is not found return the key itself. |
static final BasicTranslator GLOBAL
@Nullable java.lang.String translate(java.lang.String key)
null if the key is not found.key - The key to translatenulldefault java.lang.String translateOrKey(java.lang.String key)
key - The key to translate