Skip to content

Commit c14bfc8

Browse files
doc: use new import syntax in samples (#100)
1 parent 968d048 commit c14bfc8

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

packages/google-cloud-translate/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ The [Cloud Translation API](https://cloud.google.com/translate/docs), can dynami
3737

3838
```javascript
3939
// Imports the Google Cloud client library
40-
const Translate = require('@google-cloud/translate');
40+
const {Translate} = require('@google-cloud/translate');
4141

4242
// Your Google Cloud Platform project ID
4343
const projectId = 'YOUR_PROJECT_ID';

packages/google-cloud-translate/samples/quickstart.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
// [START translate_quickstart]
1919
// Imports the Google Cloud client library
20-
const Translate = require('@google-cloud/translate');
20+
const {Translate} = require('@google-cloud/translate');
2121

2222
// Your Google Cloud Platform project ID
2323
const projectId = 'YOUR_PROJECT_ID';

packages/google-cloud-translate/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ export class Translate extends Service {
210210
* @returns {Promise<DetectResponse>}
211211
*
212212
* @example
213-
* const Translate = require('@google-cloud/translate');
213+
* const {Translate} = require('@google-cloud/translate');
214214
*
215215
* const translate = new Translate();
216216
*
@@ -570,7 +570,7 @@ promisifyAll(Translate, {exclude: ['request']});
570570
* @google-cloud/translate
571571
*
572572
* @example <caption>Import the client library:</caption>
573-
* const Translate = require('@google-cloud/translate');
573+
* const {Translate} = require('@google-cloud/translate');
574574
*
575575
* @example <caption>Create a client that uses <a
576576
* href="https://goo.gl/64dyYX">Application Default Credentials

0 commit comments

Comments
 (0)