()
| 103 | // const target = 'The target language, e.g. ru'; |
| 104 | |
| 105 | async function translateText() { |
| 106 | // Translates the text into the target language. "text" can be a string for |
| 107 | // translating a single piece of text, or an array of strings for translating |
| 108 | // multiple texts. |
| 109 | let [translations] = await translate.translate(text, target); |
| 110 | translations = Array.isArray(translations) ? translations : [translations]; |
| 111 | console.log('Translations:'); |
| 112 | translations.forEach((translation, i) => { |
| 113 | console.log(`${text[i]} => (${target}) ${translation}`); |
| 114 | }); |
| 115 | } |
| 116 | |
| 117 | translateText(); |
| 118 | // [END translate_translate_text] |
no outgoing calls
no test coverage detected