Class TranslationApiImpl

    • Constructor Detail

      • TranslationApiImpl

        public TranslationApiImpl​(ApiContext context)
    • Method Detail

      • translate

        @Nonnull
        public Translation translate​(@Nullable
                                     java.lang.String text,
                                     @Nonnull
                                     Language language)
        Translates text to the specified language. Source language is detected by text. Text format is TextFormat.PLAIN_TEXT.
        Specified by:
        translate in interface TranslationApi
        Parameters:
        text - the text to translate
        language - the target language for translation
        Returns:
        translated text
      • translate

        @Nonnull
        public Translation translate​(@Nullable
                                     java.lang.String text,
                                     @Nonnull
                                     Direction direction)
        Translates text to the specified language. Text format is TextFormat.PLAIN_TEXT.
        Specified by:
        translate in interface TranslationApi
        Parameters:
        text - the text to translate
        direction - the direction of translation
        Returns:
        translated text
      • translate

        @Nonnull
        public Translation translate​(@Nullable
                                     java.lang.String text,
                                     @Nonnull
                                     Direction direction,
                                     @Nullable
                                     TextFormat format)
        Translates text to the specified language.
        Specified by:
        translate in interface TranslationApi
        Parameters:
        text - the text to translate
        direction - the direction of translation
        format - the text format
        Returns:
        translated text