Skip to content

Commit

Permalink
chore: remove snippet leading whitespace (#467)
Browse files Browse the repository at this point in the history
  • Loading branch information
chingor13 authored Mar 19, 2020
1 parent 34fd214 commit 404b032
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions packages/google-cloud-translate/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,31 +60,31 @@ npm install @google-cloud/translate
### Using the client library

```javascript
/**
* TODO(developer): Uncomment the following line before running the sample.
*/
// const projectId = 'YOUR_PROJECT_ID';
/**
* TODO(developer): Uncomment the following line before running the sample.
*/
// const projectId = 'YOUR_PROJECT_ID';

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

// Instantiates a client
const translate = new Translate({projectId});
// Instantiates a client
const translate = new Translate({projectId});

async function quickStart() {
// The text to translate
const text = 'Hello, world!';
async function quickStart() {
// The text to translate
const text = 'Hello, world!';

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

// Translates some text into Russian
const [translation] = await translate.translate(text, target);
console.log(`Text: ${text}`);
console.log(`Translation: ${translation}`);
}
// Translates some text into Russian
const [translation] = await translate.translate(text, target);
console.log(`Text: ${text}`);
console.log(`Translation: ${translation}`);
}

quickStart();
quickStart();

```

Expand Down

0 comments on commit 404b032

Please sign in to comment.