Skip to content

About astro-content-ai-translator

AI-powered translation utility for Astro websites. Automatically generates localized content from files in your content/ directory, supporting both single-page and multi-page i18n workflows.

Features

Automatic Translation

Point at your content directory, configure target languages, and get translations. No manual copying or placeholder creation needed.

Workflow Flexibility

Supports both single-page translation for quick updates and batch multi-page processing for comprehensive localization.

Astro i18n Integration

Works seamlessly with Astro’s built-in internationalization features. Outputs content in the expected structure.

Format Preservation

Maintains your Markdown/MDX formatting, frontmatter structure, and component usage. Translations look like your originals.

How It Works

# Install the tool
npm install astro-content-ai-translator

# Configure target languages
# (in your config file)

# Run translation
npx translate-content --target ru,ja,de

The tool:

  1. Scans your content directory
  2. Identifies untranslated content
  3. Sends content to AI translation
  4. Saves translated files in the correct structure
  5. Preserves frontmatter and formatting

Configuration

// translator.config.js
export default {
  contentDir: './src/content/pages',
  defaultLanguage: 'en',
  targetLanguages: ['ru', 'ja', 'de', 'fr'],
  // AI provider configuration
  provider: 'openai',
  // Quality settings
  preserveFormatting: true,
  reviewMode: false
}

Best Practices

For Production Content

  1. Use the tool for initial translation
  2. Have native speakers review output
  3. Make corrections in the translated files
  4. The tool won’t overwrite existing translations

For Rapid Iteration

  1. Translate early and often
  2. Use draft mode for testing
  3. Batch translate when content stabilizes

Why We Built It

Scaling affiliate sites to multiple languages is essential for global reach but expensive with human translation alone. This tool makes multi-language expansion accessible while maintaining quality.

The goal isn’t to replace human translators — it’s to accelerate the process and reduce the barrier to going multilingual.

Limitations

  • AI translation isn’t perfect — human review recommended for production
  • Very technical content may need extra attention
  • Cultural adaptation still requires human judgment

Open Source

Available on GitHub. Issues, suggestions, and contributions welcome.