Database-backed model translations for Django and DRF, with optional .po file workflow and auto-translation support
Project description
django-localekit
A Django library that adds database-backed model translations with optional Django REST Framework integration. Translations are stored in a separate table — original field values are never modified.
Features
TranslatableModelmixin — declare which fields are translatable in one line- Five DRF serializers covering all read/write translation patterns (optional)
TranslationInlinefor managing translations in the Django admin- Management commands to export/import
.pofiles and run automatic machine translation - Built-in providers: Google Translate v2/v3, AWS Translate, DeepL
- Extensible provider system — plug in any API or local LLM (OpenAI, Ollama, etc.)
Quick start
pip install django-localekit # base (no cloud SDKs)
pip install "django-localekit[deepl]" # with DeepL provider
pip install "django-localekit[all]" # all built-in providers
python manage.py migrate
# models.py
from django_localekit.models import TranslatableModel
class Article(TranslatableModel):
title = models.CharField(max_length=200)
body = models.TextField()
translatable_fields = ["title", "body"]
# serializers.py (optional DRF integration)
from django_localekit.drf.serializers import TranslatableDBSerializer
class ArticleSerializer(TranslatableDBSerializer):
class Meta:
model = Article
fields = "__all__"
A GET /articles/1/ request with Accept-Language: es returns the Spanish translation automatically.
Documentation
Full documentation is available at https://alexivanchyk.github.io/django-localekit/
Contributing
Pull requests are welcome. For major changes, please open an issue first.
License
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 django_localekit-1.0.0.tar.gz.
File metadata
- Download URL: django_localekit-1.0.0.tar.gz
- Upload date:
- Size: 15.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.3.1 CPython/3.13.11 Darwin/24.1.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3df017ea8165a85f07ccd9ff1a317ef6d541ae1e995d20d156759a084b342721
|
|
| MD5 |
164f68de20a6677a42bbf4737a94fb7d
|
|
| BLAKE2b-256 |
a0e3bde7e40303b365d04faf0cf8fbdb2381884fe0dabbdd6f768e93ac24f3d3
|
File details
Details for the file django_localekit-1.0.0-py3-none-any.whl.
File metadata
- Download URL: django_localekit-1.0.0-py3-none-any.whl
- Upload date:
- Size: 22.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.3.1 CPython/3.13.11 Darwin/24.1.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4ef4d24dfc4e37acbb5d4c7d85221eb1024fd0f34720c1c9b2efa737e9f90981
|
|
| MD5 |
8589244d46945a5bc95798e9dce71b85
|
|
| BLAKE2b-256 |
2dca7900efbc79ba486616961fa1d386340ed906fca2cc7d7dbd16eb513e735a
|