From fe60e6ee0f1d3950da010a1caa0ad35d2b45b989 Mon Sep 17 00:00:00 2001 From: Elizabeth Crowdus Date: Thu, 8 Aug 2019 15:40:18 -0700 Subject: [PATCH] fixing translate-with-glossary bug [(#2323)](https://github.com/GoogleCloudPlatform/python-docs-samples/issues/2323) --- translation/samples/snippets/beta_snippets.py | 2 +- translation/samples/snippets/beta_snippets_test.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/translation/samples/snippets/beta_snippets.py b/translation/samples/snippets/beta_snippets.py index 7cd94aed59a0..0f8a423c39ec 100644 --- a/translation/samples/snippets/beta_snippets.py +++ b/translation/samples/snippets/beta_snippets.py @@ -269,7 +269,7 @@ def translate_text_with_glossary(project_id, glossary_id, text): target_language_code='es', glossary_config=glossary_config) - for translation in result.translations: + for translation in result.glossary_translations: print(translation) # [END translate_translate_text_with_glossary_beta] diff --git a/translation/samples/snippets/beta_snippets_test.py b/translation/samples/snippets/beta_snippets_test.py index f7099a27cae1..56534c6cbad1 100644 --- a/translation/samples/snippets/beta_snippets_test.py +++ b/translation/samples/snippets/beta_snippets_test.py @@ -120,9 +120,9 @@ def test_list_glossary(capsys, glossary): def test_translate_text_with_glossary(capsys, glossary): beta_snippets.translate_text_with_glossary( - PROJECT_ID, glossary, 'directions') + PROJECT_ID, glossary, 'account') out, _ = capsys.readouterr() - assert 'direcciones' in out + assert 'cuenta' in out def test_delete_glossary(capsys, unique_glossary_id):