Package ai.tock.translator
Class I18nLabelValue
-
- All Implemented Interfaces:
-
kotlin.CharSequence
public final class I18nLabelValue implements CharSequence
A label value contains an unique key used to retrieve the translations from the database.
There is also a default label used to generate the label if no translation is found, and optional format pattern arguments for this current translation.
-
-
Field Summary
Fields Modifier and Type Field Description private final Stringnamespaceprivate final Stringcategoryprivate final Stringkeyprivate final CharSequencedefaultLabelprivate final List<Object>argsprivate final Set<I18nLocalizedLabel>defaultI18nprivate final Integerlength
-
Constructor Summary
Constructors Constructor Description I18nLabelValue(I18nLabel label)I18nLabelValue(String key, String namespace, String category, CharSequence defaultLabel, List<Object> args, Set<I18nLocalizedLabel> defaultI18n)
-
Method Summary
Modifier and Type Method Description final StringgetNamespace()Namespace of the label. final StringgetCategory()Category of the label. final StringgetKey()Unique key of the label. final CharSequencegetDefaultLabel()The fallback value if none is found for the requested locale and interface type. final List<Object>getArgs()The optional format pattern arguments. final Set<I18nLocalizedLabel>getDefaultI18n()Default values for various languages and interface types. final I18nLabelValuewithNamespace(String newNamespace)Returns the value with the given namespace. final I18nLabelValuewithArgs(List<Object> newArgs)Returns the value with the given args. StringtoString()Booleanequals(Object other)IntegerhashCode()-
-
Constructor Detail
-
I18nLabelValue
I18nLabelValue(I18nLabel label)
-
I18nLabelValue
I18nLabelValue(String key, String namespace, String category, CharSequence defaultLabel, List<Object> args, Set<I18nLocalizedLabel> defaultI18n)
-
-
Method Detail
-
getNamespace
final String getNamespace()
Namespace of the label.
-
getCategory
final String getCategory()
Category of the label.
-
getDefaultLabel
final CharSequence getDefaultLabel()
The fallback value if none is found for the requested locale and interface type.
If a TranslatorEngine is configured, this default label will also be used for automated translation.
-
getDefaultI18n
final Set<I18nLocalizedLabel> getDefaultI18n()
Default values for various languages and interface types.
-
withNamespace
final I18nLabelValue withNamespace(String newNamespace)
Returns the value with the given namespace.
-
withArgs
final I18nLabelValue withArgs(List<Object> newArgs)
Returns the value with the given args.
-
-
-
-