Markdown

Languine supports Markdown file localization, perfect for documentation, blog posts, and content-heavy sites. This format preserves Markdown syntax while translating content, including front matter support.


Setting Up

First, make sure you've got a languine.json config file in your project root. Here's an example:

typescript
{
  "locale": {
    "source": "en",
    "targets": ["sv", "de", "fr"]
  },
  "files": {
    "md": {
      "include": ["content/[locale]/**/*.md"]
    }
  }
}

Translating

With your config set, run:

typescript
npx languine@latest translate

When you run this command, Languine will:

  • Load your source Markdown files (e.g., content/en/*.md)
  • Detect any new or modified content
  • Generate translations for your target languages
  • Create or update the target language files (e.g., content/sv/*.md)
  • Preserve Markdown formatting and structure
  • Handle front matter translations
  • Maintain links and references
  • Keep code blocks untranslated
  • Preserve HTML within Markdown