# Cloud Translation V3 Client - Class DocumentTranslation (2.3.0)

2.3.0 (latest) 2.2.0 2.1.2 2.0.3 1.21.0 1.20.2 1.19.0 1.18.1 1.17.7 1.16.0 1.15.4 1.14.3 1.13.3 1.12.12 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` | `string[]` 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.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<string>` |   |

### setByteStreamOutputs

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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |