Translate XML content while preserving document structure, tags, and namespaces. Optionally translate attribute values in addition to text content. Suitable for XLIFF files, Android string resources, and other XML-based formats.
HTTP Request
| |
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
source | string | No | "auto" | Source language code. Use auto for automatic detection |
target | string | Yes | — | Target language code |
translate_attributes | boolean | No | false | Whether to translate XML attribute values in addition to text content |
Request Body
Send the XML content as the raw request body with Content-Type: application/xml.
| |
Response
| |
Response Fields
| Field | Type | Description |
|---|---|---|
status | boolean | Whether the request was successful |
data.translated_xml | string | The translated XML content with structure preserved |
data.source_language | string | Detected or specified source language code |
data.source_language_name | string | Human-readable name of the source language |
Code Examples
| |
| |
| |
Related Endpoints
- Translate HTML — Translate HTML content
- Translate Strings — Translate Apple .strings files
- Translate — Translate plain text