Skip to main content
MDX combines Markdown prose with JSX components. Hyperlocalise translates supported prose while preserving JSX structure and expressions. Render the result to check custom components and layout. Supported extensions: .mdx.

Source file

Save this example as locales/en-US/messages.mdx.

Configure your files

Use this i18n.yml for the example, or add its file mapping to your existing bucket. See path templates for other layouts.

Translate

Install the CLI and set OPENAI_API_KEY in your project’s .env.local or shell. You can also configure another AI provider.
The dry run previews the work. The second command writes translations to the configured target path and updates the lockfile.

Behavior and limitations

  • Uses the MDX parser to translate prose while preserving JSX structure and expressions.
  • Frontmatter and fenced code blocks stay unchanged. Keep executable content in expressions or code blocks.
  • Review rendered output after translating pages with custom components. Support for MDX does not mean arbitrary component properties are translation messages.

Next steps