Class Translate.TranslateOption

    • Method Detail

      • sourceLanguage

        public static Translate.TranslateOption sourceLanguage​(String sourceLanguage)
        Returns an option for setting the source language. If not provided, Google Translation will try to detect the language of the text to translate.
        Parameters:
        sourceLanguage - the source language code
      • model

        public static Translate.TranslateOption model​(String model)
        Sets the language translation model. You can use this parameter to take advantage of Neural Machine Translation. Possible values are base and nmt. Google Translation could use a different model to translate your text: use Translation.getModel() to know which model was used for translation. Please note that you must be whitelisted to use this option, otherwise translation will fail.
        Parameters:
        model - the language translation model
      • format

        public static Translate.TranslateOption format​(String format)
        Sets the format of the source text, in either HTML (default) or plain-text. A value of html indicates HTML and a value of text indicates plain-text.
        Parameters:
        format - the format of the source text
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object