Skip to content

Commit 577f0d1

Browse files
author
Patrick Huang
committed
update javadoc and use setFormat to set translate format
1 parent ffdf22e commit 577f0d1

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

google-cloud-translate/src/main/java/com/google/cloud/translate/Translate.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ public static TranslateOption model(String model) {
9898

9999
/**
100100
* Sets the format of the source text, in either HTML (default) or plain-text.
101-
* A value of html indicates HTML and a value of text indicates plain-text.
101+
* A value of {@code html} indicates HTML and a value of {@code text} indicates plain-text.
102102
*
103-
* @param format the format of the source text (html|text)
103+
* @param format the format of the source text
104104
*/
105105
public static TranslateOption format(String format) {
106106
return new TranslateOption(TranslateRpc.Option.FORMAT, format);

google-cloud-translate/src/main/java/com/google/cloud/translate/spi/v2/HttpTranslateRpc.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public List<TranslationsResource> translate(List<String> texts, Map<Option, ?> o
126126
.setSource(sourceLanguage)
127127
.setKey(options.getApiKey())
128128
.set("model", Option.MODEL.getString(optionMap))
129-
.set(Option.FORMAT.value(), Option.FORMAT.getString(optionMap))
129+
.setFormat(Option.FORMAT.getString(optionMap))
130130
.execute()
131131
.getTranslations();
132132
return Lists.transform(

0 commit comments

Comments
 (0)