()
| 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] |