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:
- Extract messages into .po files (creates entries with empty msgstr):
python manage.py makemessages -all
- 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
- Compile translations into .mo files (so Django can use them at runtime):
python manage.py compilemessages
License
Mozilla Public License Version 2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
82b8ee13dcb21418e4ea6dbf7592ef3c34b5547b5f93b46c33a69a052328f1e2
|
|
| MD5 |
6d3d2fa4668258c2e5d33790a2182471
|
|
| BLAKE2b-256 |
23557a3aeafaeb5430e83d2bd50b560d43a945b06b75647ca2d34861824628ff
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
625e2a6772e9ad9b4e0b47d02552ad969a3aa27a52e4085ae62bb5d8b46a516f
|
|
| MD5 |
5a798deeb394ba0639dc3b23b0167898
|
|
| BLAKE2b-256 |
6eee70f01c73ebf898fe28e161b38acf7a05896c2926540ba5c74670de2e53f0
|