Configuration Reference
Complete guide to configuring PageTurner for your documentation translation needs.
Basic Configuration
Minimal Setup
from transaurus import DocusaurusMaster
master = DocusaurusMaster(
# Required parameters
source_repo_url="https://github.com/your-org/docs",
target_languages=["es", "fr", "zh-Hans"],
# Authentication (required)
github_pat="ghp_xxxxx...",
anthropic_api_key="sk-ant-xxxxx...",
)
result = master.run_full_translation_pipeline()
Complete Configuration
from transaurus import DocusaurusMaster
master = DocusaurusMaster(
# Source repository
source_repo_url="https://github.com/your-org/docs",
source_language="en", # Default: "en"
# Target languages
target_languages=["es", "fr", "de", "ja", "zh-Hans"],
# GitHub configuration
github_pat="ghp_xxxxx...",
github_target_org="your-org-i18n", # Default: "{org}-i18n"
# AI configuration
anthropic_api_key="sk-ant-xxxxx...",
openai_api_key="sk-xxxxx...", # Optional
google_api_key="xxxxx...", # Optional
# Deployment
vercel_token="xxxxx...", # Optional
)
# Run with options
result = master.run_full_translation_pipeline(
run_mode="FULL_RUN", # or "DRY_RUN", "FAKE_TRANSLATE"
)
Required Parameters
source_repo_url (string, required)
GitHub URL of your source Docusaurus repository.
Format: https://github.com/{org}/{repo}
Example:
source_repo_url="https://github.com/facebook/docusaurus"
target_languages (list, required)
List of target language codes (ISO 639-1).
Format: List of 2-letter language codes
Example:
target_languages=["es", "fr", "de", "ja"]
github_pat (string, required)
GitHub Personal Access Token with repo scope.
How to get:
- Go to GitHub Settings → Tokens
- Check
reposcope - Generate token
Example:
github_pat="ghp_1A2B3C4D5E6F7G8H9I0J"
anthropic_api_key (string, required)
Anthropic API key for Claude AI.
How to get:
- Visit Anthropic Console
- Create API key
- Add credits ($5+ recommended)
Example:
anthropic_api_key="sk-ant-api03-xxx..."
Optional Parameters
source_language (string, optional)
Source language code. Default: "en"
Example:
source_language="en" # English
github_target_org (string, optional)
GitHub organization for translated repositories.
Default: {source_org}-i18n
Example:
# Source: https://github.com/facebook/docusaurus
# Default target org: "facebook-i18n"
# Custom:
github_target_org="facebook-translations"
vercel_token (string, optional)
Vercel API token for automatic deployment.
How to get:
- Go to Vercel Settings → Tokens
- Create token
Example:
vercel_token="1234567890abcdef"
Note: Without Vercel token, translations are created on GitHub but not automatically deployed.
openai_api_key (string, optional)
OpenAI API key for GPT models (used for specialized tasks).
Example:
openai_api_key="sk-proj-xxx..."
google_api_key (string, optional)
Google API key for Gemini models (used for multimodal content).
Example:
google_api_key="AIzaSy..."
Supported Languages
PageTurner supports 100+ languages via Claude AI. Common language codes:
Most Popular
| Language | Code | Example Translation Time (100 pages) |
|---|---|---|
| Spanish | es | 20-30 min |
| French | fr | 20-30 min |
| German | de | 20-30 min |
| Japanese | ja | 25-35 min |
| Chinese (Simplified) | zh-Hans | 25-35 min |
| Chinese (Traditional) | zh-Hant | 25-35 min |
| Korean | ko | 25-35 min |
| Portuguese | pt | 20-30 min |
| Russian | ru | 25-35 min |
| Arabic | ar | 30-40 min |
European Languages
["es", "fr", "de", "it", "pt", "ru", "pl", "nl", "sv", "da", "no", "fi"]
Asian Languages
["ja", "ko", "zh-Hans", "zh-Hant", "th", "vi", "id", "ms"]
All Supported Languages
See ISO 639-1 language codes for complete list.
Note: Translation quality varies by language. Major languages (es, fr, de, ja, zh) average 91+/100. Less common languages may be 85-90/100.
Run Modes
PageTurner supports three execution modes:
1. FULL_RUN (Default)
Complete translation and deployment pipeline.
What it does:
- ✅ Clones source repository
- ✅ Analyzes and segments content
- ✅ Translates using AI (costs API credits)
- ✅ Creates mirror repositories on GitHub
- ✅ Deploys to Vercel (if token provided)
Usage:
result = master.run_full_translation_pipeline(run_mode="FULL_RUN")
When to use: Production translation with real deployment
2. DRY_RUN
Planning and validation mode - no LLM calls or deployments.
What it does:
- ✅ Clones source repository
- ✅ Analyzes and segments content
- ✅ Shows what would be translated
- ❌ No AI translation (no API costs)
- ❌ No repository creation
- ❌ No deployment
Usage:
result = master.run_full_translation_pipeline(run_mode="DRY_RUN")
When to use:
- Estimate translation costs before committing
- Validate source repository is compatible
- Check how many segments will be translated
- Test configuration without spending credits
Output:
📊 DRY RUN Summary:
- Source repository: validated ✓
- Translatable segments: 156
- Estimated tokens: 45,000
- Estimated cost: $4.50
- Target languages: es, fr, zh-Hans
- Repository structure: valid ✓
3. FAKE_TRANSLATE
Full pipeline testing with fake translations (uses source language as "translation").
What it does:
- ✅ Clones source repository
- ✅ Analyzes and segments content
- ✅ "Translates" (copies source as translation)
- ✅ Creates mirror repositories on GitHub
- ✅ Deploys to Vercel (if token provided)
- ⚠️ Minimal API costs (no real translation)
Usage:
result = master.run_full_translation_pipeline(run_mode="FAKE_TRANSLATE")
When to use:
- Test deployment pipeline without translation costs
- Verify repository creation works
- Test Vercel integration
- Validate CI/CD workflows
- Debug issues without spending credits
Result: Deployed sites in "Spanish", "French", etc. but all content is still in English.
Repository Organization
Default Structure
Source repository:
https://github.com/your-org/docs
Mirror repositories (default):
https://github.com/your-org-i18n/docs-es
https://github.com/your-org-i18n/docs-fr
https://github.com/your-org-i18n/docs-zh-hans
Custom Organization
master = DocusaurusMaster(
source_repo_url="https://github.com/your-org/docs",
github_target_org="your-org-translations",
target_languages=["es", "fr"],
)
# Creates:
# https://github.com/your-org-translations/docs-es
# https://github.com/your-org-translations/docs-fr
Repository Naming Convention
Format: {repo-name}-{language-code}
Examples:
docs→docs-es,docs-fr,docs-jadocumentation→documentation-es,documentation-frmy-awesome-docs→my-awesome-docs-es,my-awesome-docs-fr
Deployment Options
Automatic Vercel Deployment
With Vercel token, PageTurner automatically:
- Creates Vercel project
- Links to GitHub repository
- Configures build settings
- Deploys to production
- Returns deployment URL
Configuration:
master = DocusaurusMaster(
# ... other config
vercel_token="your_vercel_token",
)
result = master.run_full_translation_pipeline()
print(result['vercel_deployment_urls'])
# {
# 'es': 'https://docs-es.vercel.app',
# 'fr': 'https://docs-fr.vercel.app',
# }
Manual Deployment
Without Vercel token, you can deploy manually:
Option 1: Import to Vercel
- Go to Vercel
- Click "New Project"
- Import from GitHub
- Select
your-org-i18n/docs-es - Deploy
Option 2: Netlify
- Go to Netlify
- Add new site
- Connect to GitHub
- Select repository
- Deploy
Option 3: GitHub Pages
- Enable GitHub Pages in repository settings
- Configure build workflow
- Deploy to
gh-pagesbranch
Advanced Configuration
Custom Configuration File (Optional)
Create transaurus.config.json in your project:
{
"source_repo_url": "https://github.com/your-org/docs",
"target_languages": ["es", "fr", "de", "ja", "zh-Hans"],
"source_language": "en",
"github_target_org": "your-org-i18n",
"deployment": {
"platform": "vercel",
"auto_deploy": true
},
"translation": {
"quality_threshold": 85,
"retry_failed_segments": true
}
}
Load configuration:
import json
from transaurus import DocusaurusMaster
with open("transaurus.config.json") as f:
config = json.load(f)
master = DocusaurusMaster(**config)
Cost Estimation
Translation Costs
Costs depend on:
- Number of pages
- Content length
- Number of target languages
- Translation memory reuse
Typical costs (using Claude Sonnet):
| Pages | Languages | First Translation | Updates (with TM) |
|---|---|---|---|
| 50 | 3 | $15 | $2-3 |
| 100 | 3 | $30 | $3-5 |
| 200 | 3 | $60 | $6-10 |
| 100 | 10 | $100 | $10-15 |
Formula: ~$0.10 per page per language (first translation)
Cost Optimization
1. Use Translation Memory
- First translation: $30 for 100 pages × 3 languages
- Update 10 pages: $3 (90% savings)
2. Use DRY_RUN First
# Estimate costs before running
result = master.run_full_translation_pipeline(run_mode="DRY_RUN")
print(f"Estimated cost: ${result['estimated_cost']}")
3. Translate Incrementally
- Translate high-priority pages first
- Add languages gradually
- Use translation memory across projects
Troubleshooting
Configuration Validation
PageTurner validates configuration on startup:
✓ Source repository accessible
✓ GitHub PAT has required permissions
✓ Anthropic API key valid
✓ Target languages supported
✓ Repository structure valid
Common Issues
"Invalid source repository"
- Ensure repository is a valid Docusaurus site
- Check docusaurus.config.js exists
- Verify repository is accessible with GitHub PAT
"Insufficient GitHub permissions"
- GitHub PAT must have
reposcope - Regenerate token if needed
"Anthropic API error"
- Check API key is valid
- Ensure sufficient credits ($5+ recommended)
- Verify rate limits not exceeded
Next Steps
- Run your first translation - Quick getting started guide
- Understand the pipeline - How PageTurner works
- Check FAQ - Common questions and troubleshooting
Questions? Contact us or book a demo.