Translating Markdown and MDX Content at Scale
How to translate Markdown and MDX files without breaking formatting, links, code blocks, or frontmatter. AST-based parsing, segment extraction, and reassembly.
Translating Markdown sounds simple until you try it. You can't just throw the raw file at a translation API — code blocks get translated, link URLs get mangled, and frontmatter metadata ends up in French. Here's what actually works.
The naive approach and why it fails
The tempting first attempt: