18
18
function detectLanguage ( text ) {
19
19
// [START translate_detect_language]
20
20
// Imports the Google Cloud client library
21
- const Translate = require ( '@google-cloud/translate' ) ;
21
+ const { Translate} = require ( '@google-cloud/translate' ) ;
22
22
23
23
// Creates a client
24
24
const translate = new Translate ( ) ;
@@ -51,7 +51,7 @@ function detectLanguage(text) {
51
51
function listLanguages ( ) {
52
52
// [START translate_list_codes]
53
53
// Imports the Google Cloud client library
54
- const Translate = require ( '@google-cloud/translate' ) ;
54
+ const { Translate} = require ( '@google-cloud/translate' ) ;
55
55
56
56
// Creates a client
57
57
const translate = new Translate ( ) ;
@@ -74,7 +74,7 @@ function listLanguages() {
74
74
function listLanguagesWithTarget ( target ) {
75
75
// [START translate_list_language_names]
76
76
// Imports the Google Cloud client library
77
- const Translate = require ( '@google-cloud/translate' ) ;
77
+ const { Translate} = require ( '@google-cloud/translate' ) ;
78
78
79
79
// Creates a client
80
80
const translate = new Translate ( ) ;
@@ -102,7 +102,7 @@ function listLanguagesWithTarget(target) {
102
102
function translateText ( text , target ) {
103
103
// [START translate_translate_text]
104
104
// Imports the Google Cloud client library
105
- const Translate = require ( '@google-cloud/translate' ) ;
105
+ const { Translate} = require ( '@google-cloud/translate' ) ;
106
106
107
107
// Creates a client
108
108
const translate = new Translate ( ) ;
@@ -138,7 +138,7 @@ function translateText(text, target) {
138
138
function translateTextWithModel ( text , target , model ) {
139
139
// [START translate_text_with_model]
140
140
// Imports the Google Cloud client library
141
- const Translate = require ( '@google-cloud/translate' ) ;
141
+ const { Translate} = require ( '@google-cloud/translate' ) ;
142
142
143
143
// Creates a client
144
144
const translate = new Translate ( ) ;
0 commit comments