Metadata-Version: 2.4
Name: tlate
Version: 0.2.0
Summary: Deterministic extract/apply/QA engine so AI agents translate documents across languages without overwriting sources.
Author: Sendy
License-Expression: MIT
Project-URL: Homepage, https://github.com/sndiy/tlate
Project-URL: Repository, https://github.com/sndiy/tlate
Project-URL: Issues, https://github.com/sndiy/tlate/issues
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Classifier: Topic :: Text Processing :: Linguistic
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: THIRD_PARTY_NOTICES.md
Provides-Extra: office
Requires-Dist: lxml>=6.0; extra == "office"
Provides-Extra: yaml
Requires-Dist: PyYAML>=6.0.2; extra == "yaml"
Provides-Extra: pdf
Requires-Dist: pymupdf>=1.28.2; extra == "pdf"
Provides-Extra: compare
Requires-Dist: Pillow>=12.0; extra == "compare"
Provides-Extra: ocr
Requires-Dist: pypdfium2>=5.0; extra == "ocr"
Requires-Dist: Pillow>=12.0; extra == "ocr"
Requires-Dist: tesserocr>=2.13.0; extra == "ocr"
Provides-Extra: all
Requires-Dist: lxml>=6.0; extra == "all"
Requires-Dist: PyYAML>=6.0.2; extra == "all"
Requires-Dist: pymupdf>=1.28.2; extra == "all"
Requires-Dist: Pillow>=12.0; extra == "all"
Provides-Extra: dev
Requires-Dist: pytest>=9.0; extra == "dev"
Requires-Dist: ruff>=0.14; extra == "dev"
Requires-Dist: lxml>=6.0; extra == "dev"
Requires-Dist: PyYAML>=6.0.2; extra == "dev"
Requires-Dist: Pillow>=12.0; extra == "dev"
Requires-Dist: pypdfium2>=5.0; extra == "dev"
Dynamic: license-file

# tlate (`0.2.0`)

[![PyPI](https://img.shields.io/pypi/v/tlate)](https://pypi.org/project/tlate/)
[![Python](https://img.shields.io/pypi/pyversions/tlate)](https://pypi.org/project/tlate/)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/sndiy/tlate/blob/main/LICENSE)
[![CI](https://github.com/sndiy/tlate/actions/workflows/ci.yml/badge.svg)](https://github.com/sndiy/tlate/actions/workflows/ci.yml)

**Universal, layout-safe translation plumbing so AI coding agents translate documents, apps, websites, and games across any language on earth without ever overwriting source files.**

`tlate` pairs an `agentskills.io`-compliant Agent Skill ([skills/tlate/SKILL.md](https://github.com/sndiy/tlate/blob/main/skills/tlate/SKILL.md)) and single-source agent ruleset ([AGENTS.md](https://github.com/sndiy/tlate/blob/main/AGENTS.md)) with a zero-dependency Python CLI (`tlate`). Your AI agent (Codex, Claude Code, Cursor, Antigravity, GitHub Copilot) focuses solely on linguistic quality and character voice while deterministic Python handles parsing, hybrid OCR, tag/placeholder protection, project sync, adaptive layout, visual comparison, and Smart QA. `tlate` performs **no LLM API calls** inside the CLI; translation quality depends on your AI agent's model and human review.

[Quick Start](#quick-start) · [Supported Formats](#supported-formats) · [Usage Guides](#usage-guides) · [Agent Prompts](#copy-paste-ai-agent-prompts) · [CLI Reference](#how-it-works--cli-reference) · [Honest Limitations](#honest-limitations) · [Documentation](#documentation)

---

## Why `tlate`?

| Problem when AI agents translate directly | How `tlate` solves it |
|---|---|
| Agents write fragile one-off parsing scripts every session, breaking code, tags, or syntax. | **The model only translates segment text**; 30+ built-in deterministic handlers (plus `tlate.formats` plugins) handle parsing, tag masking (`⟦P1⟧`), and byte-safe reconstruction. |
| Source files or previous translations get overwritten. | Every write uses exclusive creation (`open(..., "xb")`) in a fresh `tlate-output/<name>_<LANG>_<timestamp>/` folder with single-file or multi-file SHA-256 verification (`tlate verify`). |
| Placeholders (`{0:N2}`, `%1$s`), RPG Maker codes (`\C[1]`, `\N[1]`), BBCode/Ren'Py/Unity tags, URLs, or Excel formulas break. | Game, web, markup, printf, and C#/Unity tags are masked before translation (`⟦P1⟧`, `⟦S1⟧…⟦/S1⟧`) and strictly validated before any output file is written. |
| Tone and character voice drift across long chapters or multi-file repositories. | **Voice Bible** (`voice-bible.md`) + `work/stable-prefix.md` locking, per-batch speaker injection, **Adaptive 2-Pass Polish**, and shared multi-file TM keep voice consistent across hundreds of files. |
| App/game updates overwrite old work or force full re-translation. | **Incremental Patch Sync** (`tlate sync` / `--existing-target` + `--previous-source`) seeds unchanged translations and isolates only new or modified segments. |
| Encrypted or DRM-protected inputs are mishandled. | Password-protected PDFs, OLE/RMS Office files, encrypted ZIPs, and DRM EPUBs are refused upfront (exit `4`, even without extras); signed and edit-restricted inputs require explicit consent (`--allow-signed`, `--allow-edit-restricted`). |
| Scanned PDFs fail extraction or force copyleft PDF dependencies everywhere. | `tlate ocr` uses permissive `pypdfium2` + pluggable `OcrEngine` (`[ocr]` via `tesserocr` or system `tesseract` CLI) for per-page `text_layer` / `ocr` / `mixed` routing; PyMuPDF (`[pdf]`) remains strictly optional. |

---

## Quick Start

### 1. Install

```bash
# Core CLI (Python >= 3.12; zero mandatory third-party dependencies)
pip install tlate

# Optional extras as needed:
pip install "tlate[office,yaml,compare]"   # DOCX/PPTX/XLSX (lxml), YAML, PNG visual comparison
pip install "tlate[ocr]"                   # Hybrid OCR (pypdfium2 + Pillow + tesserocr>=2.13.0 MIT + local tessdata Apache-2.0)
pip install "tlate[pdf]"                   # Optional PyMuPDF PDF rewrite backend (AGPL-3.0 / Artifex commercial)
```

See [Getting Started](https://github.com/sndiy/tlate/blob/main/docs/getting-started.md) for local editable installs and `tessdata` setup.

### 2. Set Up an AI Agent Workspace (Recommended)

```bash
tlate setup ./my-translations
```

Place source files or project folders inside `./my-translations/documents/`, open `./my-translations` in your AI coding agent (`AGENTS.md`, `CLAUDE.md`, `GEMINI.md`, `.cursor/rules/tlate.mdc`, `.github/copilot-instructions.md`), and use one of the prompts in [Copy-Paste AI Agent Prompts](#copy-paste-ai-agent-prompts).

---

## Supported Formats

All core formats below require **zero third-party dependencies** unless noted under Optional Extra:

| Category | Format | Extensions / Files | Notes & Docs |
|---|---|---|---|
| **Documents & Books** | Markdown & MDX | `.md`, `.markdown`, `.mdx` | Preserves code fences, tables, JSX/imports; opt-in YAML frontmatter via `tlate.toml` ([markdown-text.md](https://github.com/sndiy/tlate/blob/main/docs/formats/markdown-text.md)) |
| | Plain text & E-books | `.txt`, `.html`, `.htm`, `.xhtml`, `.epub` | BOM/CRLF, non-UTF-8 encodings, uncompressed EPUB `mimetype`, sets `dir="rtl"` ([html-epub.md](https://github.com/sndiy/tlate/blob/main/docs/formats/html-epub.md)) |
| | Office OOXML (`[office]`) | `.docx`, `.pptx`, `.xlsx` | Direct XML editing (`w:lang`, `w:bidi`), formulas untouched, OLE refused ([office.md](https://github.com/sndiy/tlate/blob/main/docs/formats/office.md)) |
| | PDF (text & scanned OCR) | `.pdf` | Adaptive role-harmonized layout (`[pdf]`), bookmarks, hybrid `tlate ocr` (`[ocr]`) ([pdf.md](https://github.com/sndiy/tlate/blob/main/docs/formats/pdf.md), [ocr.md](https://github.com/sndiy/tlate/blob/main/docs/formats/ocr.md)) |
| **App & Mobile i18n** | JSON & Flutter ARB | `.json`, `.arb` | Nested keys, `include_keys`/`exclude_keys`, ICU plurals, `@@locale` ([i18n.md](https://github.com/sndiy/tlate/blob/main/docs/formats/i18n.md)) |
| | YAML (`[yaml]`) | `.yaml`, `.yml` | In-place edits preserving comments and structure ([i18n.md](https://github.com/sndiy/tlate/blob/main/docs/formats/i18n.md)) |
| | Gettext & Android XML | `.po`, `.pot`, `strings.xml` | `msgctxt`, CLDR `Plural-Forms`, Android escapes (`\'`), `<plurals>` ([i18n.md](https://github.com/sndiy/tlate/blob/main/docs/formats/i18n.md)) |
| | Apple Localization | `.strings`, `.xcstrings` | Cocoa strings with C comments; Xcode String Catalog plural variations ([web-and-config.md](https://github.com/sndiy/tlate/blob/main/docs/formats/web-and-config.md)) |
| | XLIFF & .NET RESX | `.xliff`, `.xlf`, `.resx` | XLIFF 1.2 & 2.0 `<source>`/`<target>`, RESX `<data>` with `<comment>` ([web-and-config.md](https://github.com/sndiy/tlate/blob/main/docs/formats/web-and-config.md)) |
| **Web, Tables & Config** | Web JSONC & JS/TS locales | `.jsonc`, `.json5`, `.js`, `.ts`, `.mjs`, `.cjs` | Comment-preserving JSON5/JSONC; `export default` / `module.exports` objects ([web-and-config.md](https://github.com/sndiy/tlate/blob/main/docs/formats/web-and-config.md)) |
| | CSV & TSV | `.csv`, `.tsv` | Auto/config columns (`key`, `source`, `target`, `speaker`, `context`, `max_chars`) ([web-and-config.md](https://github.com/sndiy/tlate/blob/main/docs/formats/web-and-config.md)) |
| | Properties & Config | `.properties`, `.ini`, `.cfg`, `.toml` | `\uXXXX` Java properties, section/comment-preserving `.ini`/`.cfg`/`.toml` ([web-and-config.md](https://github.com/sndiy/tlate/blob/main/docs/formats/web-and-config.md)) |
| **Games & Subtitles** | Subtitles | `.srt`, `.vtt`, `.ass`, `.ssa` | CJK/Latin reading speed & line limits; ASS `{\pos}`/`\N` & actor speaker preservation ([subtitles.md](https://github.com/sndiy/tlate/blob/main/docs/formats/subtitles.md), [games.md](https://github.com/sndiy/tlate/blob/main/docs/formats/games.md)) |
| | Visual Novels & RPGs | Ren'Py `.rpy`, RPG Maker MV/MZ JSON | Extracts dialogue/choices/actors (`style.speaker`), RPG codes `401`/`102`/`405` & `\C[1]` ([games.md](https://github.com/sndiy/tlate/blob/main/docs/formats/games.md)) |
| | Narrative & Scripting | `.lua`, `.yarn`, `.ink`, custom `tlate.toml` scripts | Lua tables, Yarn/Ink speaker dialogue/choices, declarative `line_regex` script rules ([games.md](https://github.com/sndiy/tlate/blob/main/docs/formats/games.md)) |
| **Third-Party Plugins** | Entry-point extensions | Any extension registered via `tlate.formats` | Custom `FormatHandler` packages discovered automatically ([project-mode.md](https://github.com/sndiy/tlate/blob/main/docs/project-mode.md)) |

### Visual PDF Comparison (`tlate compare`)

Actual `tlate compare` output on a synthetic PDF fixture (preserving colored callout boxes, raster images, `{app_name}` placeholders, and URLs):

![Side-by-side comparison of source PDF and translated PDF](https://raw.githubusercontent.com/sndiy/tlate/main/docs/demo/pdf-compare.png)

> **Multi-Language Support (`--from auto`, required `--to`):** Ships `24` built-in language packs under `languages/` (checked via `tlate lang check`) plus universal generic BCP-47 fallback ([skills/tlate/references/style-guides/default.md](https://github.com/sndiy/tlate/blob/main/skills/tlate/references/style-guides/default.md)) for any unlisted or regional language (e.g., `sv-SE`, `jv`, `ks-Arab`).

---

## Usage Guides

### 1. Single-File Mode

`--to <lang>` is required (no default target language); `--from` defaults to `auto`:

```bash
tlate init documents/guide.md --from en --to ja
tlate inspect documents/guide.md --to ja --json tlate-output/guide_JA_<timestamp>/reports/inventory.json
tlate extract documents/guide.md --result tlate-output/guide_JA_<timestamp>
# Or for scanned / mixed PDFs:
tlate ocr documents/scan.pdf --result tlate-output/scan_ID_<timestamp> --overlays

tlate glossary-scan tlate-output/guide_JA_<timestamp>/work/segments.jsonl --from en --to ja
tlate pilot tlate-output/guide_JA_<timestamp>/work/segments.jsonl --count 10
tlate batch tlate-output/guide_JA_<timestamp>/work/segments.jsonl --max-tokens 1500 \
  --glossary tlate-output/guide_JA_<timestamp>/glossary.md \
  --voice-bible tlate-output/guide_JA_<timestamp>/voice-bible.md --wire-format compact

# After writing translations to work/translations/*.jsonl:
tlate apply --result tlate-output/guide_JA_<timestamp>
tlate qa documents/guide.md tlate-output/guide_JA_<timestamp>/output/guide_JA.md \
  --result tlate-output/guide_JA_<timestamp> \
  --report tlate-output/guide_JA_<timestamp>/reports/QA_report.md \
  --review-csv tlate-output/guide_JA_<timestamp>/reports/review_sheet.csv
tlate verify tlate-output/guide_JA_<timestamp>
```

### 2. Multi-File / Project Mode (`tlate init <dir>`)

Translate an entire app, web repository, or RPG `data/` folder under one shared `glossary.md`, `voice-bible.md`, and translation memory (`work/tm.jsonl`), mirroring the relative directory layout into `output/` without ever modifying sources:

```bash
tlate init ./locales_src --from en --to id --profile web
tlate extract ./locales_src --result tlate-output/locales_src_ID_<timestamp>
tlate batch tlate-output/locales_src_ID_<timestamp>/work/segments.jsonl --wire-format compact
tlate apply --result tlate-output/locales_src_ID_<timestamp>
tlate qa --result tlate-output/locales_src_ID_<timestamp>
tlate verify tlate-output/locales_src_ID_<timestamp>
```

See [Project Mode & `tlate.toml`](https://github.com/sndiy/tlate/blob/main/docs/project-mode.md).

### 3. Incremental / Patch Sync (`tlate sync`)

When upstream strings update (`v1 -> v2`), preserve existing reviewed translations and translate only new or changed lines:

```bash
# Option A: seed directly during extract
tlate init ./game_v2 --from ja --to en --profile rpgmaker
tlate extract ./game_v2 --result tlate-output/game_v2_EN_<timestamp> \
  --existing-target ./game_en_v1 --previous-source ./game_v1

# Option B: run sync after extract
tlate sync ./game_v2 --result tlate-output/game_v2_EN_<timestamp> \
  --existing-target ./game_en_v1 --previous-source ./game_v1
```

### 4. Voice Bible (Separated vs. Combined) & Adaptive 2-Pass Polish

- **Separated (default):** Store terminology + forbidden translations in `<result>/glossary.md` and style/register, speaker character cards, and linguistic briefs in `<result>/voice-bible.md`. `tlate batch` and `tlate qa` auto-detect `voice-bible.md` beside `glossary.md` or inside `<result>/` (or accept `--voice-bible <path>`).
- **Combined (small single files):** Append `## Style & Register`, `## Characters / Voices`, and `## Linguistic Brief` directly inside `glossary.md`. If both files exist, `voice-bible.md` takes precedence.
- **Adaptive 2-Pass Polish:** Pilot samples, dialogue, narrative prose, game scripts, subtitles, editorial text, and long paragraphs use a mandatory 2-pass workflow (**Draft -> Native Grammar & Voice Polish**), while short technical UI labels use 1-pass + quick token/length verification. See [Voice Bible & Quality](https://github.com/sndiy/tlate/blob/main/docs/voice-and-quality.md).

### 5. `tlate.toml` Configuration, Presets & Non-UTF-8 Encodings

Drop a `tlate.toml` in your project root (or pass `--config` / `--profile` / `--encoding`) to configure presets (`rpgmaker`, `unity`, `renpy`, `web`, `mobile`, `docs`, `generic`), key/file filtering, custom tag patterns, length limits, declarative script rules, and legacy encodings (`shift_jis`/`cp932`, `utf-16-le`, `utf-16-be`, `euc_kr`, `gb18030`, `cp1252`):

```toml
profile = "rpgmaker"
encoding = "shift_jis"
exclude_keys = ["*.id", "*.bgm*", "*.se*"]
max_chars = 120
max_lines = 4

[[protect_patterns]]
name = "custom_hero_tag"
pattern = '\\[hero:\w+\\]'
```

---

## Copy-Paste AI Agent Prompts

For non-technical users working in Codex, Claude Code, Cursor, Antigravity, or Copilot after running `tlate setup ./my-translations`:

1. **Document / PDF / Office Translation:**
   > Translate `documents/report.pdf` from English to Indonesian (`--from en --to id`) using `tlate`. Build the glossary and Voice Bible first, stop for my approval, run a 10-segment pilot with visual comparison and back-translation glosses, then finish QA and `tlate verify`.
2. **Game / Visual Novel / RPG Translation:**
   > Translate the folder `documents/my_rpg_data/` from Japanese to English (`--from ja --to en`) using `--profile rpgmaker` (or `renpy`) and `--encoding shift_jis` if needed. Create both `glossary.md` and a separate `voice-bible.md` for all speakers, stop at Glossary and Pilot checkpoints (showing back-translation glosses and voice rationale), and check `max_chars` limits during `tlate qa`.
3. **Web / App Multi-File Project Localization:**
   > Localize `documents/app-locales/` from English to German (`--from en --to de`) as a unified `tlate` project using `--profile web` (or `mobile`). Keep all JSON/ARB/PO/XCStrings placeholders intact, verify German CLDR plural categories in `tlate qa`, and run `tlate verify` at the end.
4. **Game or App Patch Update (`tlate sync`):**
   > Update our localization using `tlate sync`: source `v2` is in `documents/locales_v2/`, previous `v1` source is in `documents/locales_v1/`, and existing Japanese translations are in `documents/locales_ja_v1/`. Seed unchanged lines first and only translate new or modified segments.
5. **Regional / Low-Resource Language Translation:**
   > Translate `documents/storybook.docx` into Javanese (`--to jv`) using `skills/tlate/references/style-guides/default.md` for universal calibration. Explain up front which deterministic checks are skipped in generic mode, propose dialect/register choices in `voice-bible.md`, stop for pilot review with back-translation glosses, and finish with full QA and `tlate verify`.

---

## How It Works & CLI Reference

```text
Source file or directory (read-only, SHA-256) + optional tlate.toml
  │
  ▼  tlate init / inspect
Inventory + protection checks (refuses encrypted/DRM, flags risky layouts)
  │
  ▼  tlate extract (or tlate ocr / tlate sync --existing-target)
work/segments.jsonl (masked with ⟦Pn⟧ / ⟦Sn⟧ tokens) + work/tm.jsonl
  │
  ▼  tlate glossary-scan / pilot / batch + work/stable-prefix.md + voice-bible.md + glossary.md
AI Agent translates segment text only (Adaptive 2-Pass Polish) --> work/translations/*.jsonl
  │
  ▼  tlate apply (exclusive write xb)
output/<stem>_<LANG>.<ext>  OR  mirrored output/<rel_path>
  │
  ▼  tlate qa / compare / review-sheet / verify
reports/QA_report.md (constraints, Voice Bible, CLDR plurals) + review_sheet.csv + SHA-256 verify
```

| Command | Purpose |
|---|---|
| `tlate setup <dir>` | Prepare an isolated agent workspace (`AGENTS.md`, `CLAUDE.md`, `GEMINI.md`, Cursor/Copilot rules, `skills/tlate/`, `documents/`). |
| `tlate init <src> --to <lang>` | Create a fresh timestamped `tlate-output/<name>_<LANG>_<timestamp>/` result folder (single file or directory). |
| `tlate inspect <src> --to <lang>` | Inspect protection status, format, encoding, `risky_layouts`, and initial `cost_preview`. |
| `tlate extract <src> --result <dir>` | Stream segment extraction (`--resume`, `--existing-target`, `--previous-source`, `--config`, `--profile`, `--encoding`). |
| `tlate ocr <pdf> --result <dir>` | Hybrid `pypdfium2` + pluggable `OcrEngine` extraction for scanned/mixed PDFs (`--overlays`, `--export-crops`). |
| `tlate sync <src> --result <dir> --existing-target <old>` | Re-seed unchanged translations into `work/translations/` via 2-way or 3-way (`--previous-source`) comparison. |
| `tlate glossary-scan <segments>` | Extract multi-script recurring terminology candidates (Latin, CJK, Korean, Arabic, Cyrillic, Thai, Devanagari). |
| `tlate pilot <segments>` | Pick a position/type/speaker-diverse sample (`--count N`) for Checkpoint 2 review. |
| `tlate batch <segments>` | Plan resumable, voice-locked, glossary-filtered batches (`--voice-bible`, `--wire-format compact`, `--fuzzy-tm`, `--budget-tokens`). |
| `tlate apply --result <dir>` | Strictly validate `⟦Pn⟧` tokens, restore tags/encoding, and write output via exclusive `open(..., "xb")`. |
| `tlate compare <src> <out>` | Render side-by-side PNG comparisons (`--pages`, `--zoom`). |
| `tlate qa [<src> <out>] --result <dir>` | Run Smart QA (pass `<src> <out>` for single files, or `--result <dir>` alone for project dirs): numbers, placeholders, URLs, glossary, duplicates, `max_chars`/`max_lines`/`max_bytes`, `--voice-bible`, CLDR plurals, leftovers, typography, optional Hunspell. |
| `tlate review-sheet --result <dir>` | Export deterministic RFC 4180 CSV review sheet (`100%` flagged + stratified unflagged sample). |
| `tlate verify <dir>` | Re-hash source and recorded outputs via SHA-256 to prove zero mutations. |
| `tlate lang check` | Validate all `24` built-in language packs under `languages/` (`--json`). |

See [Architecture](https://github.com/sndiy/tlate/blob/main/docs/architecture.md) for the `tlate/segments@1` contract, plugin registry (`tlate.formats`), and CLI exit codes (`0`–`7`).

---

## Honest Limitations

- **Does not guarantee error-free translations.** `tlate qa` is heuristic (`max_chars`/`max_lines`/`max_bytes`, light Voice Bible avoid-term checks, CLDR plural category validation, leftover stopwords, numbers, placeholders, and URLs); manual review and back-translation sampling remain essential.
- **Any language vs. dedicated packs:** `24` built-in packs under `languages/` start at `status: "draft"`, while unlisted BCP-47 languages use generic fallback (`default.md`). Both warn up front and list `unchecked_rules` in `QA_report.md`.
- **Legacy non-UTF-8 encodings:** When `--encoding` (such as `shift_jis`, `cp932`, `euc_kr`, `gb18030`, `cp1252`, `utf-16-le`) cannot represent target-language characters, `tlate apply` refuses with an explicit `ValidationError` rather than silently losing text.
- **Game scripts & binary assets:** Complex runtime procedural string concatenation, compiled script bytecode, binary game archives, and text baked inside raster images/textures are not automatically extracted.
- **Scanned/mixed PDF OCR fidelity is lower:** Original raster fonts, textured backgrounds behind OCR boxes (replaced by solid white `(1, 1, 1)` fill during `apply`), kerning, skewed/handwritten text, and complex multi-column tables are not preserved verbatim ([ocr.md](https://github.com/sndiy/tlate/blob/main/docs/formats/ocr.md)).
- **Dense PDF overflow & Arabic ligatures:** Overflowing boxes after adaptive fit are rendered unclipped (never truncated) and flagged (`overflow_after_adaptive_fit`), while `inspect` flags `risky_layouts`. Arabic (`ar`) PDF text extraction emits ToUnicode CMap ligature artifacts (`LIMITED_FOR_PDF`; see [layout-metrics.md](https://github.com/sndiy/tlate/blob/main/docs/layout-metrics.md)).
- **RTL visual verification:** `tlate` sets `dir="rtl"` / `w:bidi` and checks RTL script characters, but mixed bidirectional punctuation and number ordering require manual visual review.
- **No built-in LLM API client:** `tlate` intentionally performs zero LLM API calls inside the CLI; translation quality depends on your agent's model and human review.
- **Protected files & legal disclaimers:** `tlate` never decrypts password-protected files, never removes DRM, refuses `apply` on edit-restricted PDFs, and never produces certified/sworn legal translations ([protected-files.md](https://github.com/sndiy/tlate/blob/main/docs/protected-files.md)).

---

## License & PyMuPDF Notice

- This repository is licensed under the **MIT License** ([LICENSE](https://github.com/sndiy/tlate/blob/main/LICENSE)), and the core `tlate` package has **zero mandatory third-party dependencies**.
- The optional PDF rewriting backend uses **PyMuPDF** (`[pdf]`), **never vendored** in this repository and dual-licensed under **GNU AGPL-3.0** or an **Artifex commercial license**. See [THIRD_PARTY_NOTICES.md](https://github.com/sndiy/tlate/blob/main/THIRD_PARTY_NOTICES.md) and [Security, Privacy & Licensing](https://github.com/sndiy/tlate/blob/main/docs/security-and-copyright.md).

---

## Documentation

| Area | Guides |
|---|---|
| **Setup & Workflow** | [Getting Started](https://github.com/sndiy/tlate/blob/main/docs/getting-started.md) · [Voice Bible & Quality](https://github.com/sndiy/tlate/blob/main/docs/voice-and-quality.md) · [Project Mode, Sync & Plugins](https://github.com/sndiy/tlate/blob/main/docs/project-mode.md) · [Glossary Guide](https://github.com/sndiy/tlate/blob/main/docs/glossary-howto.md) · [QA Guide](https://github.com/sndiy/tlate/blob/main/docs/qa.md) · [Troubleshooting](https://github.com/sndiy/tlate/blob/main/docs/troubleshooting.md) |
| **Formats** | [Games & Subtitles](https://github.com/sndiy/tlate/blob/main/docs/formats/games.md) · [Subtitles (SRT/VTT)](https://github.com/sndiy/tlate/blob/main/docs/formats/subtitles.md) · [Web, Mobile & Config](https://github.com/sndiy/tlate/blob/main/docs/formats/web-and-config.md) · [i18n (JSON/ARB/YAML/PO/XML)](https://github.com/sndiy/tlate/blob/main/docs/formats/i18n.md) · [PDF](https://github.com/sndiy/tlate/blob/main/docs/formats/pdf.md) · [OCR](https://github.com/sndiy/tlate/blob/main/docs/formats/ocr.md) · [Office OOXML](https://github.com/sndiy/tlate/blob/main/docs/formats/office.md) · [HTML & EPUB](https://github.com/sndiy/tlate/blob/main/docs/formats/html-epub.md) · [Markdown & Text](https://github.com/sndiy/tlate/blob/main/docs/formats/markdown-text.md) |
| **Languages** | [Adding a Language Pack](https://github.com/sndiy/tlate/blob/main/docs/adding-a-language.md) · [Universal Style Guide](https://github.com/sndiy/tlate/blob/main/skills/tlate/references/style-guides/default.md) · [Indonesian Style Guide](https://github.com/sndiy/tlate/blob/main/languages/id/style-guide.md) |
| **Architecture & Evals** | [Architecture](https://github.com/sndiy/tlate/blob/main/docs/architecture.md) · [Evaluations (37/37)](https://github.com/sndiy/tlate/blob/main/docs/evals.md) · [PDF Layout Metrics](https://github.com/sndiy/tlate/blob/main/docs/layout-metrics.md) · [Efficiency & Benchmarks](https://github.com/sndiy/tlate/blob/main/docs/efficiency.md) · [Known Issues](https://github.com/sndiy/tlate/blob/main/docs/known-issues.md) |
| **Security & Governance** | [Security, Privacy & Licensing](https://github.com/sndiy/tlate/blob/main/docs/security-and-copyright.md) · [Protected Files](https://github.com/sndiy/tlate/blob/main/docs/protected-files.md) · [Password Mode Design](https://github.com/sndiy/tlate/blob/main/docs/design-password-mode.md) · [Python Support](https://github.com/sndiy/tlate/blob/main/docs/python-support.md) · [Dependencies Audit](https://github.com/sndiy/tlate/blob/main/docs/dependencies.md) · [Claims Map](https://github.com/sndiy/tlate/blob/main/docs/claims.md) · [Credits](https://github.com/sndiy/tlate/blob/main/docs/credits.md) |
| **Community & Releases** | [Contributing](https://github.com/sndiy/tlate/blob/main/CONTRIBUTING.md) · [Code of Conduct](https://github.com/sndiy/tlate/blob/main/CODE_OF_CONDUCT.md) · [Security Policy](https://github.com/sndiy/tlate/blob/main/SECURITY.md) · [Changelog](https://github.com/sndiy/tlate/blob/main/CHANGELOG.md) · [Release Checklist](https://github.com/sndiy/tlate/blob/main/docs/release-checklist.md) |
