Reference documentation and code samples for the Cloud Translation V3 Client class DocumentTranslation.
A translated document message.
Generated from protobuf message google.cloud.translation.v3.DocumentTranslation
Namespace
Google \ Cloud \ Translate \ V3
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ byte_stream_outputs
array
The array of translated documents. It is expected to be size 1 for now. We may produce multiple translated documents in the future for other type of file formats.
↳ mime_type
string
The translated document's mime type.
↳ detected_language_code
string
The detected language for the input document. If the user did not provide the source language for the input document, this field will have the language code automatically detected. If the source language was passed, auto-detection of the language does not occur and this field is empty.
getByteStreamOutputs
The array of translated documents. It is expected to be size 1 for now. We
may produce multiple translated documents in the future for other type of
file formats.
The array of translated documents. It is expected to be size 1 for now. We
may produce multiple translated documents in the future for other type of
file formats.
Parameter
Name
Description
var
string[]
Returns
Type
Description
$this
getMimeType
The translated document's mime type.
Returns
Type
Description
string
setMimeType
The translated document's mime type.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getDetectedLanguageCode
The detected language for the input document.
If the user did not provide the source language for the input document,
this field will have the language code automatically detected. If the
source language was passed, auto-detection of the language does not occur
and this field is empty.
Returns
Type
Description
string
setDetectedLanguageCode
The detected language for the input document.
If the user did not provide the source language for the input document,
this field will have the language code automatically detected. If the
source language was passed, auto-detection of the language does not occur
and this field is empty.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-09 UTC."],[],[],null,["# Cloud Translation V3 Client - Class DocumentTranslation (2.0.3)\n\nVersion latestkeyboard_arrow_down\n\n- [2.0.3 (latest)](/php/docs/reference/cloud-translate/latest/V3.DocumentTranslation)\n- [2.0.2](/php/docs/reference/cloud-translate/2.0.2/V3.DocumentTranslation)\n- [1.21.0](/php/docs/reference/cloud-translate/1.21.0/V3.DocumentTranslation)\n- [1.20.2](/php/docs/reference/cloud-translate/1.20.2/V3.DocumentTranslation)\n- [1.19.0](/php/docs/reference/cloud-translate/1.19.0/V3.DocumentTranslation)\n- [1.18.1](/php/docs/reference/cloud-translate/1.18.1/V3.DocumentTranslation)\n- [1.17.7](/php/docs/reference/cloud-translate/1.17.7/V3.DocumentTranslation)\n- [1.16.0](/php/docs/reference/cloud-translate/1.16.0/V3.DocumentTranslation)\n- [1.15.4](/php/docs/reference/cloud-translate/1.15.4/V3.DocumentTranslation)\n- [1.14.3](/php/docs/reference/cloud-translate/1.14.3/V3.DocumentTranslation)\n- [1.13.3](/php/docs/reference/cloud-translate/1.13.3/V3.DocumentTranslation)\n- [1.12.12](/php/docs/reference/cloud-translate/1.12.12/V3.DocumentTranslation) \nReference documentation and code samples for the Cloud Translation V3 Client class DocumentTranslation.\n\nA translated document message.\n\nGenerated from protobuf message `google.cloud.translation.v3.DocumentTranslation`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Translate \\\\ V3\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getByteStreamOutputs\n\nThe array of translated documents. It is expected to be size 1 for now. We\nmay produce multiple translated documents in the future for other type of\nfile formats.\n\n### setByteStreamOutputs\n\nThe array of translated documents. It is expected to be size 1 for now. We\nmay produce multiple translated documents in the future for other type of\nfile formats.\n\n### getMimeType\n\nThe translated document's mime type.\n\n### setMimeType\n\nThe translated document's mime type.\n\n### getDetectedLanguageCode\n\nThe detected language for the input document.\n\nIf the user did not provide the source language for the input document,\nthis field will have the language code automatically detected. If the\nsource language was passed, auto-detection of the language does not occur\nand this field is empty.\n\n### setDetectedLanguageCode\n\nThe detected language for the input document.\n\nIf the user did not provide the source language for the input document,\nthis field will have the language code automatically detected. If the\nsource language was passed, auto-detection of the language does not occur\nand this field is empty."]]