Interface TranslationApi

    • 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 is TextFormat.PLAIN_TEXT.
        Parameters:
        text - the text to translate
        language - 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 is TextFormat.PLAIN_TEXT.
        Parameters:
        text - the text to translate
        direction - 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 translate
        direction - the direction of translation
        format - the text format
        Returns:
        translated text