# GoogleTranslateTransformer

> **Class** in `langchain_google_community`

📖 [View in docs](https://reference.langchain.com/python/langchain-google-community/translate/GoogleTranslateTransformer)

Translate text documents using Google Cloud Translation.

Inherits from
[`BaseDocumentTransformer`][langchain_core.documents.BaseDocumentTransformer].

Transforms documents by translating their content using Google Cloud Translation API
with support for custom models and glossaries.

!!! note "Installation"

    Requires additional dependencies:

    ```bash
    pip install langchain-google-community[translate]
    ```

See [Translation API documentation](https://cloud.google.com/translate/docs) for
detailed information.

## Signature

```python
GoogleTranslateTransformer(
    self,
    project_id: str,
    *,
    location: str = 'global',
    model_id: Optional[str] = None,
    glossary_id: Optional[str] = None,
    api_endpoint: Optional[str] = None,
)
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `project_id` | `str` | Yes | Google Cloud Project ID. |
| `location` | `str` | No | Translation service location. (default: `'global'`) |
| `model_id` | `Optional[str]` | No | Custom translation model ID. (default: `None`) |
| `glossary_id` | `Optional[str]` | No | Glossary ID for specialized translations. (default: `None`) |
| `api_endpoint` | `Optional[str]` | No | Regional API endpoint. (default: `None`) |

## Extends

- `BaseDocumentTransformer`

## Constructors

```python
__init__(
    self,
    project_id: str,
    *,
    location: str = 'global',
    model_id: Optional[str] = None,
    glossary_id: Optional[str] = None,
    api_endpoint: Optional[str] = None,
) -> None
```

| Name | Type |
|------|------|
| `project_id` | `str` |
| `location` | `str` |
| `model_id` | `Optional[str]` |
| `glossary_id` | `Optional[str]` |
| `api_endpoint` | `Optional[str]` |


## Properties

- `project_id`
- `location`
- `model_id`
- `glossary_id`

## Methods

- [`transform_documents()`](https://reference.langchain.com/python/langchain-google-community/translate/GoogleTranslateTransformer/transform_documents)

---

[View source on GitHub](https://github.com/langchain-ai/langchain-google/blob/982e4015b249de8b9ba1e787746d8cc1f6d6b790/libs/community/langchain_google_community/translate.py#L8)