public static class Translate.TranslateOption extends Object
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
static Translate.TranslateOption |
format(String format)
Sets the format of the source text, in either HTML (default) or plain-text.
|
int |
hashCode() |
static Translate.TranslateOption |
model(String model)
Sets the language translation model.
|
static Translate.TranslateOption |
sourceLanguage(String sourceLanguage)
Returns an option for setting the source language.
|
static Translate.TranslateOption |
targetLanguage(String targetLanguage)
Returns an option for setting the target language.
|
String |
toString() |
public static Translate.TranslateOption sourceLanguage(String sourceLanguage)
sourceLanguage
- the source language codepublic static Translate.TranslateOption targetLanguage(String targetLanguage)
TranslateOptions.getTargetLanguage()
is used.targetLanguage
- the target language codepublic static Translate.TranslateOption model(String model)
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.model
- the language translation modelpublic static Translate.TranslateOption format(String format)
html
indicates HTML and a value of text
indicates plain-text.format
- the format of the source textCopyright © 2019 Google LLC. All rights reserved.