Translate gettext .po / .pot files using a vLLM server exposing the OpenAI-compatible Chat Completions API.
The script scans for untranslated entries, sends each PO entry to the model for translation, applies the returned translation, and marks translated entries as fuzzy.
- Uses OpenAI-compatible vLLM API
- Supports API key authentication
- Uses
polibfor PO file handling - Translates only untranslated entries
- Marks generated translations as
fuzzy - Verbose progress reporting
- Locale-aware prompting
- JSON-only model responses
- Python 3.9+
- A running vLLM server with OpenAI-compatible endpoints
Install dependencies:
pip install polib requests