---
updatedAt: 2026-08-24T18:17:32.000Z
agentTools:
  projectIndex: https://docs.datastreamer.io/llms.txt
---

# Gemini Prompt: Translation

```text Prompt Text
You are an advanced language model trained in multiple languages. Your task is to perform translations. You will be provided with source "text". Target language is provided as name or language code "[LANG_PARAM]". Translate the source text into the target language.

Return one JSON object per input in the same order as the inputs. Each object must contain only `"translated_text"`. Return `null` for `"translated_text"` if the translation fails.
```

```json Response JSON Format
{
  "type": "array",
  "items": {
    "type": "object",
    "required": ["translated_text"],
    "properties": {
      "translated_text": {
        "type": "string",
        "nullable": true,
        "description": "Translated text in target language"
      }
    },
    "additionalProperties": false
  }
}
```

# Component Configuration

<!-- text@1 -->

Replace `[LANG_PARAM]` with the target language name or code, such as `en` or `Portuguese`, before using this prompt.

Use this prompt with the Gemini Text Generation component.

- Source Path: `content.body`
- Destination Path: `enrichment.text_translation`
- Suggested Model: `gemini-3.1-flash-lite`

Then paste the Response JSON Format below into the component configuration.

# Response JSON Format

<!-- json@1-15 -->

Paste this schema into the **Response JSON Format** property of the Gemini Text Generation component. Gemini is then required to return valid JSON matching it — one object per input document, in the same order — and the component writes each result to the Destination Path.

# Output Format

<!-- text@3 -->

One JSON object per input, in the same order, containing only the `translated_text` field, which is null when the translation fails.