/** * Returns an option for setting the target language. If this option is not provided, the value * returned by {@link TranslateOptions#targetLanguage()} is used. * * @param targetLanguage the target language code */ public static TranslateOption targetLanguage(String targetLanguage) { return new TranslateOption(TranslateRpc.Option.TARGET_LANGUAGE, targetLanguage); } }
/** * Sets the format of the source text, in either HTML (default) or plain-text. A value of {@code * html} indicates HTML and a value of {@code text} indicates plain-text. * * @param format the format of the source text */ public static TranslateOption format(String format) { return new TranslateOption(TranslateRpc.Option.FORMAT, format); } }
/** * Returns an option for setting the source language. If not provided, Google Translate will try * to detect the language of the text to translate. * * @param sourceLanguage the source language code */ public static TranslateOption sourceLanguage(String sourceLanguage) { return new TranslateOption(TranslateRpc.Option.SOURCE_LANGUAGE, sourceLanguage); }
/** * Returns an option for setting the target language. If this option is not provided, the value * returned by {@link TranslateOptions#getTargetLanguage()} is used. * * @param targetLanguage the target language code */ public static TranslateOption targetLanguage(String targetLanguage) { return new TranslateOption(TranslateRpc.Option.TARGET_LANGUAGE, targetLanguage); }
/** * Returns an option for setting the source language. If not provided, Google Translation will * try to detect the language of the text to translate. * * @param sourceLanguage the source language code */ public static TranslateOption sourceLanguage(String sourceLanguage) { return new TranslateOption(TranslateRpc.Option.SOURCE_LANGUAGE, sourceLanguage); }
/** * Sets the language translation model. You can use this parameter to take advantage of Neural * Machine Translation. Possible values are {@code base} and {@code nmt}. Google Translation * could use a different model to translate your text: use {@link 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. * * @param model the language translation model */ public static TranslateOption model(String model) { return new TranslateOption(TranslateRpc.Option.MODEL, model); }
/** * Sets the format of the source text, in either HTML (default) or plain-text. A value of {@code * html} indicates HTML and a value of {@code text} indicates plain-text. * * @param format the format of the source text */ public static TranslateOption format(String format) { return new TranslateOption(TranslateRpc.Option.FORMAT, format); } }
/** * Returns an option for setting the source language. If not provided, Google Translation will * try to detect the language of the text to translate. * * @param sourceLanguage the source language code */ public static TranslateOption sourceLanguage(String sourceLanguage) { return new TranslateOption(TranslateRpc.Option.SOURCE_LANGUAGE, sourceLanguage); }
/** * Sets the language translation model. You can use this parameter to take advantage of Neural * Machine Translation. Possible values are {@code base} and {@code nmt}. Google Translation * could use a different model to translate your text: use {@link 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. * * @param model the language translation model */ public static TranslateOption model(String model) { return new TranslateOption(TranslateRpc.Option.MODEL, model); }
/** * Returns an option for setting the target language. If this option is not provided, the value * returned by {@link TranslateOptions#getTargetLanguage()} is used. * * @param targetLanguage the target language code */ public static TranslateOption targetLanguage(String targetLanguage) { return new TranslateOption(TranslateRpc.Option.TARGET_LANGUAGE, targetLanguage); }