Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can you specify a source language for the google translate API? #484

Closed
talkingtab opened this issue Sep 20, 2017 · 1 comment
Closed

can you specify a source language for the google translate API? #484

talkingtab opened this issue Sep 20, 2017 · 1 comment
Labels
🚨 This issue needs some love. triage me I really want to be triaged.

Comments

@talkingtab
Copy link

I would like to be able to specify a source language. I know I can autodetect, but is there a way to specify exactly the language "i" is and in Czech and so if I want to translate to French, how would I do that?

@jmdobry
Copy link
Member

jmdobry commented Sep 20, 2017

// Imports the Google Cloud client library
const Translate = require('@google-cloud/translate');

// Instantiates a client
const translate = Translate();

// The text to translate
const text = 'Ahoj světe!';

// The source language
const source = 'cs';

// The target language
const target = 'fr';

const options = {
  from: source,
  to: target
};

translate.translate(text, options)
  .then((results) => {
    console.log(JSON.stringify(results, null, 2));
  })
  .catch((err) => {
    console.error('ERROR:', err);
  });

@jmdobry jmdobry closed this as completed Sep 20, 2017
@yoshi-automation yoshi-automation added triage me I really want to be triaged. 🚨 This issue needs some love. labels Apr 6, 2020
grayside pushed a commit that referenced this issue Oct 26, 2022
🤖 I have created a release \*beep\* \*boop\* 
---
### [2.1.3](https://www.github.com/googleapis/nodejs-tasks/compare/v2.1.2...v2.1.3) (2020-11-25)


### Bug Fixes

* **browser:** check for fetch on window ([6abe685](https://www.github.com/googleapis/nodejs-tasks/commit/6abe6853909b5c897b80854eaa5a7f8b1da26e0b))
* do not modify options object, use defaultScopes ([#484](https://www.github.com/googleapis/nodejs-tasks/issues/484)) ([039becb](https://www.github.com/googleapis/nodejs-tasks/commit/039becb02c12ee0911d536edcfb796664c4b6525))
---


This PR was generated with [Release Please](https://github.com/googleapis/release-please).
grayside pushed a commit that referenced this issue Nov 3, 2022
🤖 I have created a release \*beep\* \*boop\* 
---
### [2.1.3](https://www.github.com/googleapis/nodejs-tasks/compare/v2.1.2...v2.1.3) (2020-11-25)


### Bug Fixes

* **browser:** check for fetch on window ([6abe685](https://www.github.com/googleapis/nodejs-tasks/commit/6abe6853909b5c897b80854eaa5a7f8b1da26e0b))
* do not modify options object, use defaultScopes ([#484](https://www.github.com/googleapis/nodejs-tasks/issues/484)) ([039becb](https://www.github.com/googleapis/nodejs-tasks/commit/039becb02c12ee0911d536edcfb796664c4b6525))
---


This PR was generated with [Release Please](https://github.com/googleapis/release-please).
NimJay pushed a commit that referenced this issue Nov 11, 2022
🤖 I have created a release \*beep\* \*boop\*
---
## [2.5.0](https://www.github.com/googleapis/nodejs-kms/compare/v2.4.4...v2.5.0) (2021-08-05)


### Features

* add support for HMAC, Variable Key Destruction, and GenerateRandom ([#484](https://www.github.com/googleapis/nodejs-kms/issues/484)) ([c207423](https://www.github.com/googleapis/nodejs-kms/commit/c207423806e36057d74244e1c79294f595e5a740))
---


This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
ace-n pushed a commit that referenced this issue Nov 11, 2022
🤖 I have created a release \*beep\* \*boop\*
---
## [2.5.0](https://www.github.com/googleapis/nodejs-kms/compare/v2.4.4...v2.5.0) (2021-08-05)


### Features

* add support for HMAC, Variable Key Destruction, and GenerateRandom ([#484](https://www.github.com/googleapis/nodejs-kms/issues/484)) ([c207423](https://www.github.com/googleapis/nodejs-kms/commit/c207423806e36057d74244e1c79294f595e5a740))
---


This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚨 This issue needs some love. triage me I really want to be triaged.
Projects
None yet
Development

No branches or pull requests

3 participants