From f13718e0fd7d1fe5c774777b39a31bf981412631 Mon Sep 17 00:00:00 2001 From: Rebecca Taylor Date: Mon, 5 Aug 2019 09:52:34 -0700 Subject: [PATCH] docs(samples): fix translate with glossary sample (#306) Translation results from glossaries are in a different collection (glossary_translations rather than translations) --- .../v3beta1/translate_translate_text_with_glossary_beta.test.js | 2 +- .../v3beta1/translate_translate_text_with_glossary_beta.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/translate/test/v3beta1/translate_translate_text_with_glossary_beta.test.js b/translate/test/v3beta1/translate_translate_text_with_glossary_beta.test.js index 529c8e3f195..ba07d863b83 100644 --- a/translate/test/v3beta1/translate_translate_text_with_glossary_beta.test.js +++ b/translate/test/v3beta1/translate_translate_text_with_glossary_beta.test.js @@ -64,7 +64,7 @@ describe(REGION_TAG, () => { const output = execSync( `node v3beta1/${REGION_TAG}.js ${projectId} ${location} ${glossaryId} ${input}` ); - assert.match(output, /direcciones/); + assert.match(output, /indicaciones/); }); after(async function() { diff --git a/translate/v3beta1/translate_translate_text_with_glossary_beta.js b/translate/v3beta1/translate_translate_text_with_glossary_beta.js index 82ba3c028c6..d39536f43a0 100644 --- a/translate/v3beta1/translate_translate_text_with_glossary_beta.js +++ b/translate/v3beta1/translate_translate_text_with_glossary_beta.js @@ -55,7 +55,7 @@ function main( // Run request const [response] = await translationClient.translateText(request); - for (const translation of response.translations) { + for (const translation of response.glossaryTranslations) { console.log(`Translation: ${translation.translatedText}`); } }