{"id":50578189,"url":"https://github.com/efe/dj-translatemessages","last_synced_at":"2026-06-21T19:00:38.595Z","repository":{"id":311313429,"uuid":"1041740932","full_name":"efe/dj-translatemessages","owner":"efe","description":"LLM-powered Django translations ✨ Just call me \"python manage.py translatemessages\"","archived":false,"fork":false,"pushed_at":"2026-05-14T18:24:00.000Z","size":81,"stargazers_count":101,"open_issues_count":12,"forks_count":3,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-14T20:30:26.853Z","etag":null,"topics":["django","i18n","translation"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/yesglot/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/efe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-21T00:16:12.000Z","updated_at":"2026-05-14T18:24:04.000Z","dependencies_parsed_at":"2025-08-24T07:09:10.708Z","dependency_job_id":"bf5c3c92-c2d1-4a1b-a665-e0668662e5fe","html_url":"https://github.com/efe/dj-translatemessages","commit_stats":null,"previous_names":["efe/yesglot","efe/dj-translatemessages"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/efe/dj-translatemessages","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/efe%2Fdj-translatemessages","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/efe%2Fdj-translatemessages/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/efe%2Fdj-translatemessages/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/efe%2Fdj-translatemessages/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/efe","download_url":"https://codeload.github.com/efe/dj-translatemessages/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/efe%2Fdj-translatemessages/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34622271,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-21T02:00:05.568Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["django","i18n","translation"],"created_at":"2026-06-05T00:00:35.184Z","updated_at":"2026-06-21T19:00:38.590Z","avatar_url":"https://github.com/efe.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# dj-translatemessages\n\n[![](https://img.shields.io/pypi/v/dj-translatemessages)](https://pypi.org/project/dj-translatemessages) [![](https://img.shields.io/codecov/c/github/efe/dj-translatemessages)](https://app.codecov.io/github/efe/dj-translatemessages) [![](https://img.shields.io/github/check-runs/efe/dj-translatemessages/main)](https://github.com/efe/dj-translatemessages/actions?query=branch%3Amain) [![](https://img.shields.io/github/license/efe/dj-translatemessages)](https://github.com/efe/dj-translatemessages/blob/main/LICENSE) ![](https://img.shields.io/pypi/frameworkversions/django/dj-translatemessages)\n\n\u003e LLM-powered Django translations ✨\n\u003e Formerly published as `yesglot`.\n\nA Django app that autofills missing translations in `.po` files using an LLM, while respecting [ICU](https://unicode-org.github.io/icu/) format placeholders and source references.\n\nProject story: [The birth of yesglot.com](https://efe.me/posts/2026-05-14-the-birth-of-yesglot-com/) explains the background behind `yesglot` and the rename to `dj-translatemessages`.\n\n## Why dj-translatemessages?\n\n- 🧠 LLM-powered: works with [100+ LLM models](https://models.litellm.ai/) through LiteLLM’s unified API\n- 🔒 Placeholder-safe: keeps {name}, {{handlebars}}, URLs, and emails intact\n- 📦 Django-native: one management command: python manage.py translatemessages\n- 🧮 Cost-aware: prints per-file and total cost (via LiteLLM)\n- 🧱 Token-safe batching: automatically splits work to avoid context overflows\n\n## 🚀Quick Start\n\n### Installation\n\n```bash\npip install dj-translatemessages\n```\n\nVersion `2.0.0` renames the Django app to `dj_translatemessages`.\nIf you're upgrading from `yesglot`, update `INSTALLED_APPS` and imports accordingly.\nMigration steps: [docs/migration_guideline.md](docs/migration_guideline.md).\n\nAdd `dj_translatemessages` to your Django settings:\n\n```python\nINSTALLED_APPS = [\n    # ...\n    \"dj_translatemessages\",\n]\n```\n\n## Configuration\n\nSet the model from [100+ LLM models](https://models.litellm.ai/) and API key in your Django settings:\n\n```python\nDJ_TRANSLATEMESSAGES_LLM_MODEL = \"openai/gpt-4o-mini\"\nDJ_TRANSLATEMESSAGES_API_KEY = \"sk-...\"\n```\n\n\n## Usage\n\nA typical workflow with Django translations:\n\n1. Extract messages into .po files (creates entries with empty msgstr):\n\n```\npython manage.py makemessages -all\n```\n\n2. Autofill missing translations with `dj-translatemessages`:\n\n```\npython manage.py translatemessages\n```\n\nExample output:\n\n```\n▶ Translation run started.\nUsing translation model: openai/gpt-4o-mini\n\n• Language: French [fr]\n  - Scanning: locale/fr/LC_MESSAGES/django.po\n    Missing entries: 12. Translating…\n    Filled 12 entries in 3.21s • Cost: $0.0123\n\n============================================================\nDone in 3.76s • Files: 1 • Missing found: 12 • Filled: 12 • Total cost: $0.0123\n```\n\n3. Compile translations into .mo files (so Django can use them at runtime):\n\n```\npython manage.py compilemessages\n```\n\n## Advanced Usage\n\nOptional parameters,\n\n- `DJ_TRANSLATEMESSAGES_SAFETY_MARGIN`: 1000 (default)\n- `DJ_TRANSLATEMESSAGES_PER_ITEM_OUTPUT`: 100 (default)\n- `DJ_TRANSLATEMESSAGES_LLM_MODEL_TEMPERATURE`: 0 (default)\n\n### System Prompt\n\nIt is preconfigured, though you may override it to tailor the behavior of your translation.\n\n- `DJ_TRANSLATEMESSAGES_SYSTEM_PROMPT_FUNCTION`: for example, `\"myproject.myapp.utils.get_system_prompt\"`\n- `DJ_TRANSLATEMESSAGES_SYSTEM_PROMPT`: string\n\nDefault:\n\n\u003e You are a professional translator. Translate into the target language.\n\u003e - Keep placeholders like {name} / {{handlebars}} unchanged.\n\u003e - Keep URLs and emails unchanged.\n\u003e - Return ONLY a JSON array of strings in the same order.\n\n\n### Preamble Template\n\nIt’s already configured, but you can override it to adjust how your translation behaves.\n\n- `DJ_TRANSLATEMESSAGES_PREAMBLE_TEMPLATE_FUNCTION`: for example, `\"myproject.myapp.utils.get_preamble\"`\n- `DJ_TRANSLATEMESSAGES_PREAMBLE_TEMPLATE`: string\n\nDefault:\n\n\u003e Translate these items into {language}. Return ONLY a JSON array:\n\n# License\n\nMozilla Public License Version 2.0\n\n![dj-translatemessages Logo](assets/logo.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fefe%2Fdj-translatemessages","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fefe%2Fdj-translatemessages","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fefe%2Fdj-translatemessages/lists"}