# Cloud Translation V3 Client - Class TranslateTextResponse (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 TranslateTextResponse.

Generated from protobuf message `google.cloud.translation.v3.TranslateTextResponse`

## Namespace

Google \\ Cloud \\ Translate \\ V3

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ translations` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-translate/latest/V3.Translation>` Text translation responses with no glossary applied. This field has the same length as [`contents`](https://docs.cloud.google.com/php/docs/reference/cloud-translate/latest/V3.TranslateTextRequest#_Google_Cloud_Translate_V3_TranslateTextRequest__getContents__). |
| `↳ glossary_translations` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-translate/latest/V3.Translation>` Text translation responses if a glossary is provided in the request. This can be the same as [`translations`](https://docs.cloud.google.com/php/docs/reference/cloud-translate/latest/V3.TranslateTextResponse#_Google_Cloud_Translate_V3_TranslateTextResponse__getTranslations__) if no terms apply. This field has the same length as [`contents`](https://docs.cloud.google.com/php/docs/reference/cloud-translate/latest/V3.TranslateTextRequest#_Google_Cloud_Translate_V3_TranslateTextRequest__getContents__). |

### getTranslations

Text translation responses with no glossary applied.

This field has the same length as
[`contents`](https://docs.cloud.google.com/php/docs/reference/cloud-translate/latest/V3.TranslateTextRequest#_Google_Cloud_Translate_V3_TranslateTextRequest__getContents__).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-translate/latest/V3.Translation>` |   |

### setTranslations

Text translation responses with no glossary applied.

This field has the same length as
[`contents`](https://docs.cloud.google.com/php/docs/reference/cloud-translate/latest/V3.TranslateTextRequest#_Google_Cloud_Translate_V3_TranslateTextRequest__getContents__).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-translate/latest/V3.Translation>` |

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

### getGlossaryTranslations

Text translation responses if a glossary is provided in the request.

This can be the same as
[`translations`](https://docs.cloud.google.com/php/docs/reference/cloud-translate/latest/V3.TranslateTextResponse#_Google_Cloud_Translate_V3_TranslateTextResponse__getTranslations__)
if no terms apply. This field has the same length as
[`contents`](https://docs.cloud.google.com/php/docs/reference/cloud-translate/latest/V3.TranslateTextRequest#_Google_Cloud_Translate_V3_TranslateTextRequest__getContents__).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-translate/latest/V3.Translation>` |   |

### setGlossaryTranslations

Text translation responses if a glossary is provided in the request.

This can be the same as
[`translations`](https://docs.cloud.google.com/php/docs/reference/cloud-translate/latest/V3.TranslateTextResponse#_Google_Cloud_Translate_V3_TranslateTextResponse__getTranslations__)
if no terms apply. This field has the same length as
[`contents`](https://docs.cloud.google.com/php/docs/reference/cloud-translate/latest/V3.TranslateTextRequest#_Google_Cloud_Translate_V3_TranslateTextRequest__getContents__).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-translate/latest/V3.Translation>` |

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