Skip to content

A command-line tool to translate large documents using language models. It preserves the file formatting and simplifies migrating documentation to other languages.

License

Notifications You must be signed in to change notification settings

leynier/doculingo

Repository files navigation

DocuLingo

License: MIT Version Last commit Commit activity Stars Forks Watchers Contributors

A command-line tool to translate large documents using language models. It preserves the file formatting and simplifies migrating documentation to other languages.


Table of Contents


Overview

doculingo helps you translate documents while preserving their formatting. It currently works with Word files and aims to support additional formats in the future, making it ideal for projects that require multiple language versions without losing the original layout.


Key Features

  • Automatic Translation — uses OpenAI to safely translate paragraphs.
  • 📝 Preserves Styles — copies fonts, colors, and alignment to the translated version.
  • 📄 Document Support — currently handles large .docx files with more formats planned.
  • 🔁 Automatic Retries — retries when the API fails.
  • ⚙️ Simple CLI — clear commands with built-in help.

Installation

Run instantly with uv without installing:

uvx doculingo --help

Or install from PyPI:

pip install doculingo

Quick Start

Translate a Word document from Spanish to English:

doculingo word \
  --input file.docx \
  --output translated.docx \
  --language-source spanish \
  --language-target english

CLI Reference

Get the full list of options with:

doculingo --help

The main subcommand is word, designed for .docx files.


Development

Install the dependencies and run the tool locally:

uv lock
uv sync --all-groups --all-extras
uv run doculingo --help

Environment Variables

Copy .env.example to .env and set OPENAI_API_KEY with your OpenAI key.


License

Distributed under the MIT license. See the license file.

About

A command-line tool to translate large documents using language models. It preserves the file formatting and simplifies migrating documentation to other languages.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •