Skip to content

introduce Translate API#1023

Merged
callmehiphop merged 1 commit intogoogleapis:masterfrom
stephenplusplus:spp--translate
Jan 4, 2016
Merged

introduce Translate API#1023
callmehiphop merged 1 commit intogoogleapis:masterfrom
stephenplusplus:spp--translate

Conversation

@stephenplusplus
Copy link
Copy Markdown
Contributor

Fixes #977

To Dos

  • Enable Translate API for Travis account
  • Set env var in Travis for API key
  • Docs
  • Tests
    • Unit
    • System

Preview

var gcloud = require('gcloud');

var translate = gcloud.translate({
  key: 'API Key'
});

// Translate a string of text.
translate.translate('Hello', 'es', function(err, translation) {
  if (!err) {
    // translation = 'Hola'
  }
});

// Detect a language from a string of text.
translate.detect('Hello', function(err, results) {
  if (!err) {
    // results = {
    //   language: 'en',
    //   confidence: 1,
    //   input: 'Hello'
    // }
  }
});

// Get a list of supported languages.
translate.getLanguages(function(err, languages) {
  if (!err) {
    // languages = [
    //   'af',
    //   'ar',
    //   'az',
    //   ...
    // ]
  }
});

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Dec 15, 2015
@stephenplusplus stephenplusplus force-pushed the spp--translate branch 2 times, most recently from 0d3ac92 to 12d1d4a Compare December 15, 2015 17:59
@stephenplusplus stephenplusplus added the api: translate Issues related to the Cloud Translation API. label Dec 15, 2015
@stephenplusplus
Copy link
Copy Markdown
Contributor Author

@callmehiphop PTAQL. This one's pretty small. I just want to be sure I'm not doing anything too crazy before locking it up with the unit tests.

Comment thread lib/translate/index.js Outdated

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@callmehiphop
Copy link
Copy Markdown
Contributor

@stephenplusplus LGTM :) unit test away!

@stephenplusplus
Copy link
Copy Markdown
Contributor Author

Thanks for the review!

Comment thread README.md Outdated

This comment was marked as spam.

This comment was marked as spam.

@jgeewax
Copy link
Copy Markdown
Contributor

jgeewax commented Dec 16, 2015

/cc @ilsung

Does Translate work with service account credentials (ie, keyfile.json) ?

@stephenplusplus
Copy link
Copy Markdown
Contributor Author

Tests added: stephenplusplus@1ebcde0

@stephenplusplus stephenplusplus added the status: blocked Resolving the issue is dependent on other work. label Dec 22, 2015
@stephenplusplus
Copy link
Copy Markdown
Contributor Author

Marking as blocked until we hear from @ilsung about authenticating with a service account keyfile. (Thanks in advance for your help!)

@ilsung
Copy link
Copy Markdown

ilsung commented Jan 4, 2016

Sorry for the delay -- No, the Translate API does not support service account creds since it doesn't use OAuth. A key is required.

@stephenplusplus stephenplusplus removed the status: blocked Resolving the issue is dependent on other work. label Jan 4, 2016
@stephenplusplus
Copy link
Copy Markdown
Contributor Author

Thanks for clearing that up.

@callmehiphop if this LGTY, merge away.

callmehiphop added a commit that referenced this pull request Jan 4, 2016
@callmehiphop callmehiphop merged commit 00dfae9 into googleapis:master Jan 4, 2016
@callmehiphop
Copy link
Copy Markdown
Contributor

🍰

sofisl pushed a commit that referenced this pull request Feb 3, 2026
* feat: add jobs.delete

* fix test

* refactor

* lint

* lint

* update jobs test

* refactor

* lint

* remove unnecessary DeleteCallback

* remove unnecessary DeleteCallback

* update

* add deleteJobs() to system-test to delete stale job resources

* remove unnecessary jobs cleanup
GautamSharda pushed a commit that referenced this pull request Mar 5, 2026
* fix(deps): remove dependency on through2

* nothru!

Co-authored-by: Nicole Zhu <[email protected]>
GautamSharda pushed a commit that referenced this pull request Mar 11, 2026
🤖 I have created a release \*beep\* \*boop\* 
---
## [2.2.0](https://www.github.com/googleapis/nodejs-pubsub/compare/v2.1.0...v2.2.0) (2020-07-09)


### Features

* add flow control settings for StreamingPullRequest to pubsub.proto ([#1035](https://www.github.com/googleapis/nodejs-pubsub/issues/1035)) ([a7dff65](https://www.github.com/googleapis/nodejs-pubsub/commit/a7dff65c1a4115e75251b775f679e6beb092928e))
* move ts target to es2018 from es2016 ([#1022](https://www.github.com/googleapis/nodejs-pubsub/issues/1022)) ([016568d](https://www.github.com/googleapis/nodejs-pubsub/commit/016568df466c2a543762ab4f194b785a426ad880))
* Re-export ClientConfig from pubsub.ts in package index.ts ([#1038](https://www.github.com/googleapis/nodejs-pubsub/issues/1038)) ([c2ac083](https://www.github.com/googleapis/nodejs-pubsub/commit/c2ac083fdb5f3b71dcb3be482b8ee5c9d527342d)), closes [#972](https://www.github.com/googleapis/nodejs-pubsub/issues/972)


### Bug Fixes

* handle fallback option properly ([#1028](https://www.github.com/googleapis/nodejs-pubsub/issues/1028)) ([5dc1827](https://www.github.com/googleapis/nodejs-pubsub/commit/5dc18270220dbf39f5a871716b4dd9d002d0c536))
* update node issue template ([#1033](https://www.github.com/googleapis/nodejs-pubsub/issues/1033)) ([52ba0ae](https://www.github.com/googleapis/nodejs-pubsub/commit/52ba0ae0218c0859a03d8ad9e4f27130ceb4cc61))
---


This PR was generated with [Release Please](https://github.com/googleapis/release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: translate Issues related to the Cloud Translation API. 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