Skip to content

Commit

Permalink
chore: updated translate_v3beta1_translate_document sample (#308)
Browse files Browse the repository at this point in the history
* chore: updated translate_v3beta1_translate_document sample

* lint fix

* nit: changed view to output
  • Loading branch information
galz10 authored Dec 14, 2021
1 parent b2e23d8 commit e7c44bd
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ def translate_document(project_id: str, file_path: str):
}
)

# To view translated document, write `response.document_translation.byte_stream_outputs` to file.
# To output the translated document, uncomment the code below.
# f = open('/tmp/output', 'wb')
# f.write(response.document_translation.byte_stream_outputs)
# f.close()

# If not provided in the TranslationRequest, the translated file will only be returned through a byte-stream
# and its output mime type will be the same as the input file's mime type
print("Response: Detected Language Code - {}".format(response.document_translation.detected_language_code))
Expand Down

0 comments on commit e7c44bd

Please sign in to comment.