Skip to content

Commit e7c44bd

Browse files
authored
chore: updated translate_v3beta1_translate_document sample (#308)
* chore: updated translate_v3beta1_translate_document sample * lint fix * nit: changed view to output
1 parent b2e23d8 commit e7c44bd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

translation/samples/snippets/translate_v3beta1_translate_document.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ def translate_document(project_id: str, file_path: str):
4141
}
4242
)
4343

44-
# To view translated document, write `response.document_translation.byte_stream_outputs` to file.
44+
# To output the translated document, uncomment the code below.
45+
# f = open('/tmp/output', 'wb')
46+
# f.write(response.document_translation.byte_stream_outputs)
47+
# f.close()
48+
4549
# If not provided in the TranslationRequest, the translated file will only be returned through a byte-stream
4650
# and its output mime type will be the same as the input file's mime type
4751
print("Response: Detected Language Code - {}".format(response.document_translation.detected_language_code))

0 commit comments

Comments
 (0)