Package ai.tock.translator
Object Translator
-
- All Implemented Interfaces:
public class TranslatorThe main entry class of translator module.
-
-
Field Summary
Fields Modifier and Type Field Description private volatile Booleanenabledpublic final static TranslatorINSTANCE
-
Method Summary
-
-
Method Detail
-
initTranslator
final Unit initTranslator()
-
registerVoiceTransformer
final Unit registerVoiceTransformer(VoiceTransformer transformer)
-
unregisterVoiceTransformer
final Unit unregisterVoiceTransformer(VoiceTransformer transformer)
-
saveIfNotExist
final I18nLabel saveIfNotExist(I18nLabelValue value, Boolean readOnly)
-
saveIfNotExist
final I18nLabel saveIfNotExist(I18nLabelValue value, Locale locale, Boolean readOnly)
-
create
final I18nLabel create(I18nLabelValue value, Locale defaultLocale, List<String> alternatives)
Creates a new label. If the label key exists, increment the key with a _$count suffix.
-
translate
final TranslatedString translate(I18nLabelValue value, I18nContext context)
Translates an I18nLabelValue for the given I18nContext.
-
translate
final TranslatedSequence translate(String key, String namespace, String category, CharSequence defaultLabel, I18nContext context)
-
formatMessage
final String formatMessage(String label, I18nContext context, List<Object> args)
-
getKeyFromDefaultLabel
final String getKeyFromDefaultLabel(CharSequence label)
-
completeAllLabels
final Integer completeAllLabels(List<I18nLabel> i18n)
-
getEnabled
final Boolean getEnabled()
Translator and i18n support is disable by default. Set it to true if you want to enable i18n.
-
setEnabled
final Unit setEnabled(Boolean enabled)
Translator and i18n support is disable by default. Set it to true if you want to enable i18n.
-
-
-
-