Skip to main content

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:

  1. Go to GitHub Settings → Tokens
  2. Check repo scope
  3. Generate token

Example:

github_pat="ghp_1A2B3C4D5E6F7G8H9I0J"

anthropic_api_key (string, required)

Anthropic API key for Claude AI.

How to get:

  1. Visit Anthropic Console
  2. Create API key
  3. 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:

  1. Go to Vercel Settings → Tokens
  2. 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:

LanguageCodeExample Translation Time (100 pages)
Spanishes20-30 min
Frenchfr20-30 min
Germande20-30 min
Japaneseja25-35 min
Chinese (Simplified)zh-Hans25-35 min
Chinese (Traditional)zh-Hant25-35 min
Koreanko25-35 min
Portuguesept20-30 min
Russianru25-35 min
Arabicar30-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:

  • docsdocs-es, docs-fr, docs-ja
  • documentationdocumentation-es, documentation-fr
  • my-awesome-docsmy-awesome-docs-es, my-awesome-docs-fr

Deployment Options

Automatic Vercel Deployment

With Vercel token, PageTurner automatically:

  1. Creates Vercel project
  2. Links to GitHub repository
  3. Configures build settings
  4. Deploys to production
  5. 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

  1. Go to Vercel
  2. Click "New Project"
  3. Import from GitHub
  4. Select your-org-i18n/docs-es
  5. Deploy

Option 2: Netlify

  1. Go to Netlify
  2. Add new site
  3. Connect to GitHub
  4. Select repository
  5. Deploy

Option 3: GitHub Pages

  1. Enable GitHub Pages in repository settings
  2. Configure build workflow
  3. Deploy to gh-pages branch

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):

PagesLanguagesFirst TranslationUpdates (with TM)
503$15$2-3
1003$30$3-5
2003$60$6-10
10010$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 repo scope
  • Regenerate token if needed

"Anthropic API error"

  • Check API key is valid
  • Ensure sufficient credits ($5+ recommended)
  • Verify rate limits not exceeded

Next Steps

Questions? Contact us or book a demo.