Skip to content

translate: Add support for target option to translate.getLanguages.#1524

Closed
jmdobry wants to merge 2 commits into
googleapis:masterfrom
jmdobry:update-translate
Closed

translate: Add support for target option to translate.getLanguages.#1524
jmdobry wants to merge 2 commits into
googleapis:masterfrom
jmdobry:update-translate

Conversation

@jmdobry
Copy link
Copy Markdown
Contributor

@jmdobry jmdobry commented Aug 23, 2016

Did I do the JSDoc comments right?

This adds support for:

translate.getLanguages({
  target: 'en'
}, function (err, languages) {
  console.log(languages[0]); // { language: 'ar', name: 'Arabic' }
});
translate.getLanguages({
  target: 'ru'
}, function (err, languages) {
  console.log(languages[0]); // { language: 'ar', name: 'арабский' }
});

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Aug 23, 2016
@jmdobry jmdobry changed the title Add support for target option to translate.getLanguages. translate: Add support for target option to translate.getLanguages. Aug 23, 2016
Comment thread packages/translate/src/index.js Outdated
@@ -166,10 +166,12 @@ Translate.prototype.detect = function(input, callback) {
*
* @resource [Discover Supported Languages]{@link https://cloud.google.com/translate/v2/using_rest#supported-languages}

This comment was marked as spam.

This comment was marked as spam.

@stephenplusplus stephenplusplus added the api: translate Issues related to the Cloud Translation API. label Aug 24, 2016
Comment thread packages/translate/src/index.js Outdated
* @resource [Discover Supported Languages]{@link https://cloud.google.com/translate/v2/using_rest#supported-languages}
* @resource [Discovering Supported Languages]{@link https://cloud.google.com/translate/v2/discovering-supported-languages-with-rest}
*
* @param {string=} target - Include the languages names in the response

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@coveralls
Copy link
Copy Markdown

coveralls commented Aug 29, 2016

Coverage Status

Coverage remained the same at 100.0% when pulling ffe9e7a on jmdobry:update-translate into 069d827 on GoogleCloudPlatform:master.

@stephenplusplus
Copy link
Copy Markdown
Contributor

Made some small style changes to the tests and docs, merged in 581c3b7.

@stephenplusplus
Copy link
Copy Markdown
Contributor

Thank you for this!

@jmdobry
Copy link
Copy Markdown
Contributor Author

jmdobry commented Aug 30, 2016

Cool! When can I expect 0.2.0 to be published? Is there a set release schedule?

@jmdobry jmdobry deleted the update-translate branch August 30, 2016 14:50
@stephenplusplus
Copy link
Copy Markdown
Contributor

A batch of releases is coming today 👍

@stephenplusplus
Copy link
Copy Markdown
Contributor

Published: https://www.npmjs.com/package/@google-cloud/translate

sofisl pushed a commit that referenced this pull request Feb 25, 2026
* docs: add missing arguments to StorageOptions documentation

* note that timeout is per request
sofisl pushed a commit that referenced this pull request Mar 17, 2026
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [aspect_rules_js](https://togithub.com/aspect-build/rules_js) | http_archive | patch | `v1.36.0` -> `v1.36.1` |

---

### Release Notes

<details>
<summary>aspect-build/rules_js (aspect_rules_js)</summary>

### [`v1.36.1`](https://togithub.com/aspect-build/rules_js/releases/tag/v1.36.1)

[Compare Source](https://togithub.com/aspect-build/rules_js/compare/v1.36.0...v1.36.1)

Many companies are successfully building with rules_js.
If you're getting value from the project, please let us know!
Just comment on our [Adoption Discussion](https://togithub.com/aspect-build/rules_js/discussions/1000).

#### Using Bzlmod with Bazel 6:

Add to your `MODULE.bazel` file:

```starlark
bazel_dep(name = "aspect_rules_js", version = "1.36.1")

####### Node.js version #########

### By default you get the node version from DEFAULT_NODE_VERSION in @&#8203;rules_nodejs//nodejs:repositories.bzl
### Optionally you can pin a different node version:
bazel_dep(name = "rules_nodejs", version = "5.8.2")
node = use_extension("@&#8203;rules_nodejs//nodejs:extensions.bzl", "node")
node.toolchain(node_version = "16.14.2")

#################################

npm = use_extension("@&#8203;aspect_rules_js//npm:extensions.bzl", "npm", dev_dependency = True)

npm.npm_translate_lock(
    name = "npm",
    pnpm_lock = "//:pnpm-lock.yaml",
    verify_node_modules_ignored = "//:.bazelignore",
)

use_repo(npm, "npm")
```

#### Using WORKSPACE

Paste this snippet into your `WORKSPACE` file:

```starlark
load("@&#8203;bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "aspect_rules_js",
    sha256 = "0988cc4baa95254d5c96c2db54019df566f78f357a98272f0ee3a4a5fc9e46f1",
    strip_prefix = "rules_js-1.36.1",
    url = "https://togithub.com/aspect-build/rules_js/releases/download/v1.36.1/rules_js-v1.36.1.tar.gz",
)

load("@&#8203;aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")

rules_js_dependencies()

load("@&#8203;rules_nodejs//nodejs:repositories.bzl", "DEFAULT_NODE_VERSION", "nodejs_register_toolchains")

nodejs_register_toolchains(
    name = "nodejs",
    node_version = DEFAULT_NODE_VERSION,
)

### For convenience, npm_translate_lock does this call automatically.
### Uncomment if you don't call npm_translate_lock at all.

#load("@&#8203;bazel_features//:deps.bzl", "bazel_features_deps")
#bazel_features_deps()

load("@&#8203;aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")

npm_translate_lock(
    name = "npm",
    pnpm_lock = "//:pnpm-lock.yaml",
    verify_node_modules_ignored = "//:.bazelignore",
)

load("@&#8203;npm//:repositories.bzl", "npm_repositories")

npm_repositories()
```

To use rules_js with bazel-lib 2.x, you must additionally register the coreutils toolchain.

```starlark
load("@&#8203;aspect_bazel_lib//lib:repositories.bzl", "register_coreutils_toolchains")

register_coreutils_toolchains()
```

#### What's Changed

-   chore(deps): update dependency aspect_rules_lint to v0.9.1 by [@&#8203;renovate](https://togithub.com/renovate) in [https://togithub.com/aspect-build/rules_js/pull/1451](https://togithub.com/aspect-build/rules_js/pull/1451)
-   docs: add note about npm_translate_lock\_<hash> merge conflict resolution by [@&#8203;jbedard](https://togithub.com/jbedard) in [https://togithub.com/aspect-build/rules_js/pull/1455](https://togithub.com/aspect-build/rules_js/pull/1455)

**Full Changelog**: https://togithub.com/aspect-build/rules_js/compare/v1.36.0...v1.36.1

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/gapic-generator-typescript).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4xMzUuMCIsInVwZGF0ZWRJblZlciI6IjM3LjEzNS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->
thiyaguk09 pushed a commit to thiyaguk09/google-cloud-node-fork that referenced this pull request Mar 18, 2026
…is#1524)

* docs: add missing arguments to StorageOptions documentation

* note that timeout is per request
GautamSharda pushed a commit that referenced this pull request Mar 23, 2026
… grpc status codes for closed client errors (#1524)

**Summary**

The TestReadRows_Generic_CloseClient conformance test [is failing](https://togithub.com/googleapis/cloud-bigtable-clients-test/blob/3b0215b4a3ae88fa1f1d2ad2229b4d8069bc1a5a/tests/readrows_test.go#L754). The [assert that was failing](https://togithub.com/googleapis/cloud-bigtable-clients-test/blob/3b0215b4a3ae88fa1f1d2ad2229b4d8069bc1a5a/tests/readrows_test.go#L754) was failing because the client was sending back an error saying the client had been closed without providing a status code for the error, but the assertion requires a non-zero status code to be present. With the new code change, the error saying that the client has been closed will now have a `CANCELLED` status code as was recommended by Gemini and the assertion check will pass and the test will pass too.
GautamSharda pushed a commit that referenced this pull request Mar 25, 2026
… grpc status codes for closed client errors (#1524)

**Summary**

The TestReadRows_Generic_CloseClient conformance test [is failing](https://togithub.com/googleapis/cloud-bigtable-clients-test/blob/3b0215b4a3ae88fa1f1d2ad2229b4d8069bc1a5a/tests/readrows_test.go#L754). The [assert that was failing](https://togithub.com/googleapis/cloud-bigtable-clients-test/blob/3b0215b4a3ae88fa1f1d2ad2229b4d8069bc1a5a/tests/readrows_test.go#L754) was failing because the client was sending back an error saying the client had been closed without providing a status code for the error, but the assertion requires a non-zero status code to be present. With the new code change, the error saying that the client has been closed will now have a `CANCELLED` status code as was recommended by Gemini and the assertion check will pass and the test will pass too.
shivanee-p pushed a commit that referenced this pull request Mar 27, 2026
… grpc status codes for closed client errors (#1524)

**Summary**

The TestReadRows_Generic_CloseClient conformance test [is failing](https://togithub.com/googleapis/cloud-bigtable-clients-test/blob/3b0215b4a3ae88fa1f1d2ad2229b4d8069bc1a5a/tests/readrows_test.go#L754). The [assert that was failing](https://togithub.com/googleapis/cloud-bigtable-clients-test/blob/3b0215b4a3ae88fa1f1d2ad2229b4d8069bc1a5a/tests/readrows_test.go#L754) was failing because the client was sending back an error saying the client had been closed without providing a status code for the error, but the assertion requires a non-zero status code to be present. With the new code change, the error saying that the client has been closed will now have a `CANCELLED` status code as was recommended by Gemini and the assertion check will pass and the test will pass too.
thiyaguk09 pushed a commit to thiyaguk09/google-cloud-node-fork that referenced this pull request May 5, 2026
… grpc status codes for closed client errors (googleapis#1524)

**Summary**

The TestReadRows_Generic_CloseClient conformance test [is failing](https://togithub.com/googleapis/cloud-bigtable-clients-test/blob/3b0215b4a3ae88fa1f1d2ad2229b4d8069bc1a5a/tests/readrows_test.go#L754). The [assert that was failing](https://togithub.com/googleapis/cloud-bigtable-clients-test/blob/3b0215b4a3ae88fa1f1d2ad2229b4d8069bc1a5a/tests/readrows_test.go#L754) was failing because the client was sending back an error saying the client had been closed without providing a status code for the error, but the assertion requires a non-zero status code to be present. With the new code change, the error saying that the client has been closed will now have a `CANCELLED` status code as was recommended by Gemini and the assertion check will pass and the test will pass too.
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.

4 participants