Reliability · Aug 19, 2026
Protect Placeholders, Links, and Identifiers in AI Translation
Fluent output is not enough when a changed token can break the page. Translation workflows must protect functional content before generation begins.

Some of the most important parts of a translation should not be translated at all.
Variables, URLs, entry IDs, asset references, code samples, and formatting markers carry function rather than prose. A model can produce a natural-sounding sentence while quietly changing one of those elements and breaking the experience around it.
Reliable AI translation starts by separating language from structure.
Identify protected content before the prompt
Do not rely on a general instruction such as "preserve placeholders." First identify the exact tokens and nodes that must survive.
Protected content commonly includes:
- interpolation variables such as
{first_name}or{{ total }} - ICU message syntax and plural selectors
- URLs, email addresses, and route fragments
- HTML attributes and markdown link destinations
- Contentful entry and asset references
- code spans, fenced code blocks, and API values
- product names marked as nontranslatable
The content model and field type should help determine the protection rules. A rich-text document needs structural handling that differs from a plain-text title.
Replace risky values with stable tokens
For plain strings, one robust approach is to extract protected values and replace them with unambiguous temporary tokens before translation.
The model sees the surrounding language but cannot accidentally rewrite a destination URL or identifier. After generation, the workflow restores the original values from a server-side map.
Tokens should be unique, difficult to confuse with natural language, and validated before restoration. Never trust the model to reproduce the map itself.
Translate rich text as structure
Flattening a rich-text tree into markdown or HTML can lose important distinctions.
Text nodes are translatable. Links, embedded entries, node types, and marks are structural. Walk the document tree, translate eligible text leaves, and rebuild the original hierarchy with references untouched.
This also improves review. Editors can compare the same structure in both locales instead of reviewing a serialized approximation that may hide missing or reordered nodes.
Validate the output before saving it
Protection needs a closed loop.
After translation, verify that every expected token appears exactly where the format allows it and that no unknown token was introduced. Parse structured formats instead of checking them with a loose string comparison.
Useful failures are specific:
- missing placeholder
{total} - changed link destination in field
ctaBody - invalid ICU syntax in locale
de - unexpected rich-text node count
Rejecting malformed output at this boundary is safer than letting the problem surface during rendering or, worse, after publication.
Show protected elements in review
Reviewers should be able to recognize functional content without being distracted by it.
Use subtle styling for placeholders and protected terms. Make link text editable while keeping the destination visible and separately controlled. For embedded content, show a human-readable label alongside the immutable ID.
If a reviewer intentionally needs to change a target-market URL, treat that as a distinct localized field decision rather than an accidental side effect of translating prose.
Test with adversarial examples
The happy path is not enough. Include strings with repeated variables, adjacent punctuation, nested markdown, plural forms, right-to-left text, and placeholders that resemble ordinary words.
Protection logic should prove that it can round-trip those cases without loss before it is trusted with production content.
The takeaway
Translation quality includes functional integrity.
Extract protected content, translate only eligible language, preserve rich-text structure, validate the result, and make functional elements clear during review. A fluent sentence is valuable only when the page still works after it is published.