MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/nodejs-docs-samples / quickStart

Function quickStart

translate/quickstart.js:32–43  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

30 const translate = new Translate({projectId});
31
32 async function quickStart() {
33 // The text to translate
34 const text = 'Hello, world!';
35
36 // The target language
37 const target = 'ru';
38
39 // Translates some text into Russian
40 const [translation] = await translate.translate(text, target);
41 console.log(`Text: ${text}`);
42 console.log(`Translation: ${translation}`);
43 }
44
45 quickStart();
46 // [END translate_quickstart]

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected