Interface TranslationApi
-
- All Known Implementing Classes:
TranslationApiImpl
public interface TranslationApi
Service allows to translate text to the specified language.
Official REST API documentation
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Translation
translate(java.lang.String text, Direction direction)
Translates text to the specified language.Translation
translate(java.lang.String text, Direction direction, TextFormat format)
Translates text to the specified language.Translation
translate(java.lang.String text, Language language)
Translates text to the specified language.
-
-
-
Method Detail
-
translate
@Nonnull Translation translate(@Nullable java.lang.String text, @Nonnull Language language)
Translates text to the specified language. Source language is detected by text. Text format isTextFormat.PLAIN_TEXT
.- Parameters:
text
- the text to translatelanguage
- the target language for translation- Returns:
- translated text
-
translate
@Nonnull Translation translate(@Nullable java.lang.String text, @Nonnull Direction direction)
Translates text to the specified language. Text format isTextFormat.PLAIN_TEXT
.- Parameters:
text
- the text to translatedirection
- the direction of translation- Returns:
- translated text
-
translate
@Nonnull Translation translate(@Nullable java.lang.String text, @Nonnull Direction direction, @Nullable TextFormat format)
Translates text to the specified language.- Parameters:
text
- the text to translatedirection
- the direction of translationformat
- the text format- Returns:
- translated text
-
-