Skip to content

Support 'format' option in Translation#2253

Merged
tcoffee-google merged 2 commits intogoogleapis:masterfrom
huangp:master
Jul 20, 2017
Merged

Support 'format' option in Translation#2253
tcoffee-google merged 2 commits intogoogleapis:masterfrom
huangp:master

Conversation

@huangp
Copy link
Copy Markdown

@huangp huangp commented Jul 19, 2017

The REST api of google translate [1] supports 'format' option as query parameter. The library does not come with this option. This pull request will add support for that.

[1] https://cloud.google.com/translate/docs/reference/translate

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jul 19, 2017
@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.002%) to 81.195% when pulling ffdf22e on huangp:master into c48dc6d on GoogleCloudPlatform:master.

Copy link
Copy Markdown
Contributor

@tcoffee-google tcoffee-google left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


/**
* 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.

This comment was marked as spam.

* 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.
*
* @param format the format of the source text (html|text)

This comment was marked as spam.

.setSource(sourceLanguage)
.setKey(options.getApiKey())
.set("model", Option.MODEL.getString(optionMap))
.set(Option.FORMAT.value(), Option.FORMAT.getString(optionMap))

This comment was marked as spam.

@@ -126,6 +126,7 @@ public List<TranslationsResource> translate(List<String> texts, Map<Option, ?> o
.setSource(sourceLanguage)
.setKey(options.getApiKey())
.set("model", Option.MODEL.getString(optionMap))

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.002%) to 81.195% when pulling 577f0d1 on huangp:master into c48dc6d on GoogleCloudPlatform:master.

Copy link
Copy Markdown
Contributor

@tcoffee-google tcoffee-google left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll submit this PR as is, since there's some additional cleanup to do in Translation.java.

@tcoffee-google tcoffee-google changed the title support 'format' option for google translate api Support 'format' option in Translation Jul 20, 2017
@tcoffee-google tcoffee-google merged commit 6bd2e32 into googleapis:master Jul 20, 2017
chingor13 pushed a commit that referenced this pull request Feb 20, 2026
* chore(deps): Update gapic-generator-java to 2.26.0

PiperOrigin-RevId: 567624307

Source-Link: googleapis/googleapis@2ecf4de

Source-Link: https://github.com/googleapis/googleapis-gen/commit/a5cfbd9a05b3a134e92886114db776fb33cec9f2
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYTVjZmJkOWEwNWIzYTEzNGU5Mjg4NjExNGRiNzc2ZmIzM2NlYzlmMiJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
suztomo pushed a commit to suztomo/google-cloud-java that referenced this pull request Mar 23, 2026
meltsufin pushed a commit that referenced this pull request Apr 29, 2026
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
meltsufin pushed a commit that referenced this pull request May 1, 2026
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants