localize_template
Create a localized version of a template: translate text nodes, override images, and set RTL direction for a target locale. Publish with validation.
Instructions
Create a localized version of an existing template for a target market.
translations format: [{"id": "node_id", "translated_text": ""}, ...]
translated_text is the INNER content of the HTML element only — do not include the outer tag. The outer tag and all CSS attributes are preserved automatically. Inline HTML is supported: , , , may be used freely.
Jinja expression rules:
Preserve {{...}} structure exactly: variable names, filters, attribute keys
You MAY adapt the string VALUE inside |default('value') to sound natural
Do NOT modify {%...%} control flow expressions
image_overrides: Optional list of image URL/alt swaps. Each entry: {"id": "img_0", "url": "...", "alt_text": "...", "link_url": "..."}. IDs come from analyze_template's images list.
rtl: Set to True for right-to-left locales (Arabic, Hebrew, Farsi, etc.).
source_version: Integer revision number from search_templates. Pass this to ensure the correct HTML version is fetched on cache miss.
If publish=True and any localizable nodes have no translation, publishing is blocked. Set force=True to publish anyway.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source_external_template_id | Yes | ||
| translations | Yes | ||
| target_locale | Yes | ||
| target_template_id | Yes | ||
| target_template_name | Yes | ||
| target_template_version | Yes | ||
| subject | Yes | ||
| sender_name | Yes | ||
| created_by | Yes | ||
| preview_text | No | ||
| publish | No | ||
| force | No | ||
| image_overrides | No | ||
| rtl | No | ||
| source_version | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||