BabelizeBabelize
Getting Started

How Babelize Works

The translation pipeline — from source code to translated PR.

When you run Babelize on a project, here's what happens under the hood.

The system uses a Modular Architecture that handles everything from code analysis to translation generation.

Modular Architecture

GitHub → Workspace Validation → Extraction → Key Generation → Base Locale Handling → Translation → AST Injection → Summary → Finalization → PR

1. Workspace Validation

Babelize validates the workspace by detecting frameworks (Next.js, React), discovering files, and checking dependencies.

2. String Extraction

Translatable strings are parsed and extracted from source files (.js, .jsx, .ts, .tsx) via AST-based parsing:

  • JSX text content and translatable attributes (e.g. placeholder, title, alt, label)
  • Support for TypeScript and JavaScript files
  • Variables and string interpolations are preserved as translation placeholders

3. Key Generation

Generates clean, unique i18n keys with collision detection to associate with all extracted strings.

4. Base Locale Handling

Reads and updates the source locale file (e.g., en.json), syncing keys incrementally using lockfile source-string hashing to track unchanged, new, changed, or missing strings.

5. Translation

The translation engine processes each string:

  1. Checks the glossary for predefined terms and "Never Translate" rules
  2. Analyzes surrounding code context for maximum translation accuracy
  3. Translates strings using the NLLB-200 model or BYOK providers (Anthropic, OpenAI, Gemini, Groq, OpenRouter)

6. AST Injection

Modifies the project's source files to wrap extracted strings in framework-native translation functions (like t()), automatically injecting imports and hooks as needed.

7. Summary

Generates comprehensive metrics (files scanned, strings extracted, keys generated) and validates translations for RTL requirements and length overflow.

8. Finalization

Saves updated configurations (e.g. i18n.ts), registers necessary dependencies, cleans up temporary artifacts, and prepares the output.

Output

Babelize generates translated resource bundles and raises a PR:

  • .json or .i18n files per target language
  • Clean file structure matching your project's i18n structure
  • PR includes a detailed diff and translation report summary

Deterministic Translations

Babelize guarantees the same input + configuration produces the same output:

  • Fixed model versions — pinned per project, updated only when you opt in
  • Seed-based generation — eliminates randomness between identical requests
  • Configuration hashing — glossary + language pair + settings produce a stable hash

Processing Times

Content SizeTypical Time
< 1,000 stringsUnder 30 seconds
1,000 – 5,000 strings1–3 minutes
5,000+ strings3–10 minutes

Times vary based on repository size, number of target languages, and current system load.

Last updated: 2026-06-19

How is this guide?

On this page