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:
- Scans your content directory
- Identifies untranslated content
- Sends content to AI translation
- Saves translated files in the correct structure
- 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
- Use the tool for initial translation
- Have native speakers review output
- Make corrections in the translated files
- The tool won’t overwrite existing translations
For Rapid Iteration
- Translate early and often
- Use draft mode for testing
- 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.