Skip to content

Latest commit

Β 

History

58 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

LayoutLingua Logo

LayoutLingua

High-precision document translation engine that preserves 100% of formatting,
mathematical formulas, tables, and typography geometry.

Maintained and developed by ThanhNguyxnOrg

Download LayoutLingua for Windows Download LayoutLingua for macOS Apple Silicon Download LayoutLingua for macOS Intel Download LayoutLingua for Linux Download LayoutLingua for Android

Latest Release CI Status 219 Tests Passing Python 3.12+ Agent Skills Changelog AGPL-3.0 License

πŸ“Š Demo Β· ✨ Features Β· πŸš€ Quick Start Β· πŸ’» Usage Β· 🌍 48 Languages Β· πŸ€– Agent Skill Β· πŸ“š Doc Hub Β· πŸ“‹ Changelog Β· βš–οΈ License


Note

LayoutLingua is an open-source document translation platform available for Windows, macOS, Linux, Android, and command-line environments. It parses page geometry, isolates formulas and technical code blocks, translates prose through high-accuracy neural engines, and writes the translated content back to exact spatial coordinates without converting documents into plain text.

πŸ“Š Before & After Demonstration

LayoutLingua Side-by-Side Dual Comparison: Mathematical Paper (arXiv)

✨ Key Features

  • 🎯 Strict Layout Preservation: Keeps paragraph bounding boxes, formulas, tables, figures, tables of contents, and references intact.
  • 🌐 Universal Multi-lingual Recognition: Deep isolation of technical formulas in documents written in Vietnamese (with full tone marks), CJK (Chinese, Japanese, Korean), Cyrillic (Russian, etc.), Arabic, Hebrew, and European Latin alphabets.
  • πŸ“¦ 4 Native Platforms: Ready-to-use binaries for Windows, macOS (Apple Silicon & Intel), Linux (x86_64), and Android.
  • ⚑ Ready Out of the Box: Download, extract, and run. Packaged desktop releases do not require Python or manual model downloads.
  • πŸ“‚ Batch Processing: Drag and drop multiple files or entire folder trees into the processing queue.
  • πŸ›‘οΈ Resilient Batch Execution: A damaged or unsupported file logs an error and continues without stopping the rest of the queue.
  • πŸ”„ Background Auto-Updater (Windows): Checks for new releases in the background, downloads updates, and stages safe seamless swaps.
  • πŸ“± Native Android Companion: Lightweight Android application powered by PDFBox-Android and Google Translate for on-the-go reading.
  • πŸ€– AI Agent Skill Mode: Built-in Handoff mode adhering to the Agent Skills standard, allowing local LLMs (Codex, Claude Code, Copilot, Gemini) to translate domain-specific technical papers with full context awareness.

πŸš€ Quick Start

πŸͺŸ Windows

  1. Download LayoutLingua for Windows (.zip).
  2. Extract the archive completely.
  3. Run LayoutLingua.exe.

Tip

Windows builds include a background auto-update worker that notifies you whenever a new release is published.

🍎 macOS

  1. Download the installer for your Mac architecture:
  2. Open the .dmg file and drag LayoutLingua to your Applications folder.
  3. On first launch, right-click the app icon β†’ Open β†’ Open.

🐧 Linux (x86_64)

  1. Download LayoutLingua for Linux (.tar.gz).
  2. Extract and launch:
    tar -xzf LayoutLingua-linux-x86_64.tar.gz
    cd LayoutLingua && ./LayoutLingua

πŸ€– Android

  1. Download APK from the latest release (LayoutLingua-android-*.apk).
  2. Install the APK on your device (Android 8.0+ supported).

To build Android from source:

cd android
./gradlew assembleDebug

πŸ’» Usage Guide

1️⃣ Add Documents

  • Drag and drop PDF files or folders directly onto the application window.
  • Or click Select Files / Select Folder.

2️⃣ Choose Target Language

  • Select your target language from the dropdown menu (48 languages supported across Latin, CJK, Cyrillic, Semitic, Greek, Thai, and Hindi).

3️⃣ Translate

  • Click Translate. Each file displays live per-page progress.
  • Results are saved into a translated/ subfolder next to each input file:
    Documents/
    β”œβ”€β”€ research-paper.pdf
    └── translated/
        └── research-paper-en.pdf
    

🌍 Supported Languages & Typography Verification

LayoutLingua does not merely present a list of language codesβ€”each language tier is backed by verified font routing, ink metrics, and formula boundary protection to prevent missing glyphs (tofu boxes) and overlapping lines:

Tier Language / Script Engine & Font Routing Calibration & Precision Details
Tier 1: Precision Calibrated Vietnamese (vi) Times New Roman / Segoe / GoNoto Calibrated ink metrics (strict 1.10 line-height floor) preventing stacked tone mark collisions (ề, ở, ậ); stable rotated table header terminology.
English (en) Standard Latin / System Serif Baseline reference standard; grammar-aware LaTeX placeholder permutations; zero formula corruption.
Chinese (zh, zh-tw) SourceHanSerif{CN,TW} + System CJK Explicit zh-CN (Simplified) & zh-TW (Traditional) API routing; 1.4 line-height multiplier for dense Hanzi glyphs.
Japanese (ja) SourceHanSerifJP + Meiryo/YuGoth Kanji, Hiragana, Katakana support; 1.1 line-height multiplier; Japanese punctuation handling.
Korean (ko) SourceHanSerifKR + Malgun Hangul syllable blocks; 1.2 line-height multiplier; syllable boundary word wrapping.
Tier 2: Unicode Latin European Languages
(FR, DE, ES, IT, PT, NL, PL, CS, SV, DA, NO, FI, HU, RO, TR...)
GoNotoKurrent / Base14 fonts Full coverage for all extended Latin diacritics (Γ‘, ΓΆ, Γ§, Ε™, Γ±, Ε‚, Ε‘); automatic hyphenation budget & width fitting.
Tier 3: Script-Routed Cyrillic (ru, uk, bg) Google Noto Kurrent / DejaVu Calibrated 0.8 line-height with 0.75 leading floor; Cyrillic prose regex isolation (\u0400-\u04FF).
Semitic / RTL (ar, he) Google Noto Arabic / Hebrew Hebrew code normalization (he ↔ iw); bidirectional character range isolation in tokenizer.
Greek (el), Thai (th), Hindi (hi) Google Noto specialized fonts Dedicated Unicode range protection in prose parser (\u0370-\u03FF, \u0E00-\u0E7F, \u0900-\u097F).

πŸ€– Agent Skill

LayoutLingua follows the Agent Skills specification and integrates directly into AI coding tools (Claude Code, Codex, GitHub Copilot, Antigravity).

πŸ“¦ Install

The skills CLI pulls directly from GitHub repositories or local directories (no npm publishing required):

# Install directly from GitHub:
npx skills add ThanhNguyxnOrg/LayoutLingua -g --all

# Or install from a local clone (offline / dev):
npx skills add . -g --all

⚑ Run from Prompts

In your agent session or terminal:

/layout-lingua translate document.pdf into English

πŸ”„ Dual-Engine Modes

Mode Engine Best Suited For
Google (Default) translate.google.com Rapid batch translation without API tokens
Handoff Active AI Agent Session Technical papers, specialized terminology, high accuracy

Note

In Handoff mode, translatable text is extracted to JSONL chunks, translated by the LLM in context, and rebuilt back into the PDF with exact formula markers preserved.


πŸ“š Documentation & Engineering Hub

All technical specifications, development workflows, and platform architectures are organized in modular documents:

Topic & Guide Focus Area Status / Target
πŸ› οΈ Developer & CI/CD Guide Core translation pipeline, local setup, test runner, GitHub Actions CI & release trigger CI Tests
πŸ“ Architecture & Vision Roadmap Formula tokenization manifold, BabelDOC CJK engine integration & olmOCR vision model Vision
πŸ“± Android Build & Release Guide Gradle compilation, PDFBox-Android integration, APK signing & distribution Android
🌐 Web Architecture Blueprint Scalable browser/cloud translation service, WebAssembly & worker pools Web
🧠 Agent Knowledge Base AI assistant context, invariant rules, test regression history & domain patterns Knowledge
πŸ›‘οΈ Preservation Rules Reference Mathematical symbol matrices, regex tokens, non-prose grammar invariants Math
πŸ€– Agent Skill Specification Command schema, skill definition, dual-engine CLI workflows for AI pair programmers Skill
πŸ“‹ Changelog & Version History Comprehensive release notes, migration paths, and version audit logs Changelog

βš–οΈ License

LayoutLingua is open-source software released under the AGPL-3.0 License.
Maintained with ❀️ by ThanhNguyxnOrg.

Releases

Packages

Contributors

Languages