Skip to content
🀝 affiliate.fm

What It Is

AI-powered translation for Astro websites. Auto-generates localized content from your content/ directory.

How It Works

Mark files for translation in frontmatter:

---
title: About Us
description: Learn about our company
_translateTo: [ru, de]
---

Options:

  • _translateTo: [ru, de] β€” translate to specific locales
  • _translateTo: all β€” translate to all configured locales
  • _translateTo: false β€” explicitly don’t translate

Usage

# Translate missing content
npx astro-ai-translator

# Translate specific file
npx astro-ai-translator about.mdx

# Check status
npx astro-ai-translator --status

# Dry run (no API calls)
npx astro-ai-translator --dry-run

Cost Estimation

Before translation starts, you see:

  • Cost estimate β€” approximate tokens and USD cost
  • File list β€” what will be translated
  • Confirmation prompt β€” approve before spending
πŸ“Š TRANSLATION ESTIMATE

πŸ“ Files to translate:
   β€’ index.mdx β†’ ru (~807 tokens)
   β€’ about.mdx β†’ ru (~658 tokens)

πŸ’° Estimated cost: $0.02

Proceed with translation? [Y/n]

Supported Models

ModelInput/1MOutput/1MBest for
gpt-4.1$2.00$8.00Default, best quality
gpt-4.1-mini$0.40$1.60Good balance
gpt-4.1-nano$0.10$0.40Budget option
gpt-4o$2.50$10.00High quality
gpt-4o-mini$0.15$0.60Very cheap

Generated Files

AI-translated files include metadata:

---
title: О нас
_ai:
  source: about.mdx
  hash: a1b2c3d4e5f6
  model: gpt-4.1
  date: "2025-12-15"
---

Track source changes. Know which model was used. Identify AI vs manual translations.

Best Practices

For Production

  1. Use for initial translation
  2. Have native speakers review
  3. Make corrections in translated files
  4. 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

Limitations

  • AI translation isn’t perfect β€” human review recommended
  • Technical content may need extra attention
  • Cultural adaptation requires human judgment

Open Source

Full source on GitHub. Issues, suggestions, contributions welcome.