Skip to main content

Django app for seamless AI-assisted translation of .po files.

Project description

yesglot

A Django app that autofills missing translations in .po files using an LLM, while respecting ICU/format placeholders and source references.

Why yesglot?

  • 🧠 LLM-powered: works with 100+ LLM models through LiteLLM’s unified API
  • 🔒 Placeholder-safe: keeps {name}, {{handlebars}}, URLs, and emails intact
  • 📦 Django-native: one management command: python manage.py translatemessages
  • 🧮 Cost-aware: prints per-file and total cost (via LiteLLM)
  • 🧱 Token-safe batching: automatically splits work to avoid context overflows

Requirements

  • Python 3.10+ (recommended)
  • Django

Installation

pip install yesglot

In settings.py:

INSTALLED_APPS = [
    # ...
    "yesglot",
]

Configuration

Set the model from 100+ LLM models and API key in your Django settings:

YESGLOT_LLM_MODEL = "openai/gpt-4o-mini"
YESGLOT_API_KEY = "sk-..."

Optional parameters,

  • YESGLOT_SAFETY_MARGIN: 1000 (default)
  • YESGLOT_PER_ITEM_OUTPUT: 100 (default)

Usage

A typical workflow with Django translations:

  1. Extract messages into .po files (creates entries with empty msgstr):
python manage.py makemessages -all
  1. Autofill missing translations with yesglot:
python manage.py translatemessages

Example output:

▶ Translation run started.
Using translation model: openai/gpt-4o-mini

• Language: French [fr]
  - Scanning: locale/fr/LC_MESSAGES/django.po
    Missing entries: 12. Translating…
    Filled 12 entries in 3.21s • Cost: $0.0123

============================================================
Done in 3.76s • Files: 1 • Missing found: 12 • Filled: 12 • Total cost: $0.0123
  1. Compile translations into .mo files (so Django can use them at runtime):
python manage.py compilemessages

License

Mozilla Public License Version 2.0

Yesglot Logo

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yesglot-0.1.0a4.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

yesglot-0.1.0a4-py3-none-any.whl (18.5 kB view details)

Uploaded Python 3

File details

Details for the file yesglot-0.1.0a4.tar.gz.

File metadata

  • Download URL: yesglot-0.1.0a4.tar.gz
  • Upload date:
  • Size: 14.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for yesglot-0.1.0a4.tar.gz
Algorithm Hash digest
SHA256 82b8ee13dcb21418e4ea6dbf7592ef3c34b5547b5f93b46c33a69a052328f1e2
MD5 6d3d2fa4668258c2e5d33790a2182471
BLAKE2b-256 23557a3aeafaeb5430e83d2bd50b560d43a945b06b75647ca2d34861824628ff

See more details on using hashes here.

File details

Details for the file yesglot-0.1.0a4-py3-none-any.whl.

File metadata

  • Download URL: yesglot-0.1.0a4-py3-none-any.whl
  • Upload date:
  • Size: 18.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for yesglot-0.1.0a4-py3-none-any.whl
Algorithm Hash digest
SHA256 625e2a6772e9ad9b4e0b47d02552ad969a3aa27a52e4085ae62bb5d8b46a516f
MD5 5a798deeb394ba0639dc3b23b0167898
BLAKE2b-256 6eee70f01c73ebf898fe28e161b38acf7a05896c2926540ba5c74670de2e53f0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page