How to Use AI to Translate Content Between Languages
Translate product descriptions, emails, or documents into multiple languages.
What This Integration Does
Generic machine translation strips context. A product description for a luxury watch and the same description for a clearance tool sound identical after a round-trip through a basic translator. This workflow runs source text through an AI Agent with explicit instructions about tone, audience, and any brand or domain vocabulary you want preserved, producing translations that read like they were written by a native copywriter.
The workflow takes one source string (or a batch) and the list of target locales, then returns a dictionary keyed by locale code. It can fan out to write the translations into a Shopify storefront, a WooCommerce site, a MongoDB collection, or a CMS - the translation step itself is independent of where the strings live.
Prerequisites
- An AI Agent enabled in Spojit (any modern multilingual model).
- A source of strings to translate (e.g. shopify, woocommerce, mongodb, or a webhook).
- A destination connection where translations will be written back.
- The list of target locales, e.g.
["es-ES", "fr-FR", "de-DE", "ja-JP"].
Step 1: Trigger and Fetch Source Content
Add a Trigger node - either a Schedule for nightly catalog translation or a Webhook for on-demand single-item translation. Follow it with a Connector node that pulls source text, e.g. shopify list-products or mongodb find-documents.
Step 2: Loop Through Items
Wrap the translation step in a Loop node iterating over the items returned. For large catalogs, consider a Parallel branch with 3-5 concurrent loops to stay well under the AI provider's rate limit while finishing faster.
Step 3: Configure the AI Agent for Translation
Add a Connector node in Agent Mode. Use Structured Output so the result is a typed object keyed by locale - this is much more reliable than asking for "all translations" as a blob.
Translate the source text below into the requested locales. Preserve the
brand tone (premium, confident, concise). Keep product names and SKUs
unchanged. Adapt idioms and units of measure for each locale rather than
translating literally.
Brand glossary (do not translate):
- "FlexFit" -> "FlexFit"
- "Lifetime Guarantee" -> localize but preserve meaning
Source (en-US):
{{ item.description }}
Target locales: {{ targetLocales }}
Schema:
{
"type": "object",
"properties": {
"es-ES": { "type": "string" },
"fr-FR": { "type": "string" },
"de-DE": { "type": "string" },
"ja-JP": { "type": "string" }
}
}
Step 4: Sanity Check the Output
Add a Connector node pointing at the text connector with the count-words tool, and a Condition node that rejects translations whose word count is wildly off (e.g. less than 30% or more than 300% of the source). This catches the model returning the source unchanged or padding with explanatory text.
Step 5: Write Translations Back
Write the per-locale strings back to the source system. For Shopify, call the shopify update-product tool once per locale (or use a metafield). For a generic CMS, use the http connector with http-put to your endpoint. For your own DB, mongodb update-documents with a $set on a translations field works well.
Step 6: Log and Notify
Drop a Connector node calling slack send-message to summarize: items translated, items skipped, locales completed. For nightly batch runs, this is the only signal the team needs.
Tips
- Maintain a glossary of brand terms and inject it into every prompt - this is the single biggest quality lever.
- Cache translations keyed by a hash of the source text - if the description didn't change, don't pay to re-translate it.
- For ad copy, translate twice with different temperatures and let a human pick the better variant via a Human node.
Common Pitfalls
- Length expansion - German is roughly 30% longer than English. UI copy that fits a button in English may overflow in German. Add a max-length hint in the prompt for UI strings.
- RTL languages - Arabic and Hebrew need RTL handling in the rendering layer. Translation alone is not enough; pair it with a UI flag.
- Locale vs language -
es-ESandes-MXdiffer. Specify the country, not just the language, especially for ecommerce.
Testing
Pick five items that span your catalog (short, long, full of brand terms, full of measurements, full of idioms). Translate them and ask a native speaker to grade each on a 1-5 scale. Tune the system prompt and glossary until you reliably hit 4+ across the sample. Then turn the loop loose on the full catalog.