AI & MCP
AI translation with quality control: validator, glossary and review
AI translation with quality control is a translated text plus a validator that rejects changed blocks, links or code: the model writes, the script checks.
Key points
- The validator compares blocks, tags, links and code: if the code changes, the translation is not published.
- The blog corpus on 1 November 2026 had 8,913 blocks per language, 2,976 FAQs and 803 code blocks.
- English prose is 2.4% shorter than Italian on the same corpus.
AI translation with quality control is a translated text plus a validator that rejects the delivery if blocks, links or code change. The model writes, the script checks, a person reads a sample.
What must stay identical
- Block count and order: one paragraph fewer is a bug, not a summary.
- Code blocks: copied byte for byte, error strings included.
- Links: the
hrefvalues stay Italian, or they point at slugs that do not exist. - Numbers and names: dates, counts and package names are not translated.
The check in two commands
node scripts/validate-blog-post.js
node scripts/validate-blog-en.js
The first command checks the article contract, the second the parity between the two languages: block count, tags, links, code and Italian residue. If the second exits with code 1, the translation is not published.
The glossary
A term list closed before translating stops “blocco” from becoming “block”, “section” and “component” in the same text. @formatjs/cli extracts strings into one JSON file per language, so the glossary applies to the file, not to a single article.
What may change
- The order of sentences inside a paragraph, if the meaning holds.
- The length: English is 2.4% shorter on the prose of this corpus.
- The connectives: “quindi” must not always become “therefore”.
The human sample
The validator does not hear tone. Every week we read a sample of translated articles looking for phrases that sound machine-made, terms outside the glossary and titles that promise more than the text. A fault found in the sample is fixed across the corpus with a search.
The limitation
The structural check does not measure quality: two texts can share every block and still read badly. Italian residue is counted with a word list, so it misses short sentences and accepted loanwords. Human review stays a sample, not full coverage.
Where to continue
The rules for a multilingual site are in multilingual website, the hreflang mistakes in hreflang, common errors, the strategy in multilingual SEO. A translated blog page needs Cnippet blogs and shadcnblocks blog7, inside blog blocks and 111,985 components.
Frequently asked questions
Should I translate code blocks too?
No, and you must not touch them: they stay identical byte for byte, error strings and commands included. The validator compares the two blocks and fails when they differ.
How do I stop links from pointing at missing pages?
Copy the Italian href values without rewriting them. A translator who invents the English slug produces 404s; the validator compares the link list of every block.
What does it cost to translate 578 articles?
Roughly 412,000 tokens per pass over 1,648,149 bytes of prose: with gpt-4.1-mini at 0.40 and 1.60 USD per million, models.dev list of 1 November 2026, that is 0.16 USD of input and 0.66 of output. Retries multiply the bill.
How do I measure quality without inventing scores?
With binary checks: structural parity, identical code, valid links, Italian residue under a threshold. An invented quality score does not hold; the human sample tells you what to improve.
A human translator or a model?
A model for the first pass and a person for the sample: it costs less than a full translation and catches what the validator cannot see. For legal or commercial text, human review remains mandatory.