Metadata-Version: 2.4
Name: django-localekit
Version: 1.0.0
Summary: Database-backed model translations for Django and DRF, with optional .po file workflow and auto-translation support
License: MIT
License-File: LICENSE
Keywords: django,drf,rest-framework,translation,i18n,internationalization,localization,model-translation,gettext
Author: Alex Ivanchyk
Author-email: alexander.ivanchik@gmail.com
Requires-Python: >=3.9,<4
Classifier: Development Status :: 4 - Beta
Classifier: Framework :: Django
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3 :: Only
Provides-Extra: all
Provides-Extra: aws
Provides-Extra: deepl
Provides-Extra: google-v2
Provides-Extra: google-v3
Requires-Dist: Django (>=4.2)
Requires-Dist: boto3 (>=1.26.31) ; extra == "aws" or extra == "all"
Requires-Dist: deepl (>=1.16.1) ; extra == "deepl" or extra == "all"
Requires-Dist: djangorestframework (>=3.15)
Requires-Dist: google-cloud-translate (>=2.0.4) ; extra == "google-v2" or extra == "google-v3" or extra == "all"
Requires-Dist: polib (>=1.1)
Project-URL: Repository, https://github.com/AlexIvanchyk/django-localekit
Description-Content-Type: text/markdown

# django-localekit

[![CI](https://github.com/AlexIvanchyk/django-localekit/actions/workflows/ci.yml/badge.svg)](https://github.com/AlexIvanchyk/django-localekit/actions/workflows/ci.yml)
[![PyPI](https://img.shields.io/pypi/v/django-localekit)](https://pypi.org/project/django-localekit/)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://choosealicense.com/licenses/mit/)

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

- `TranslatableModel` mixin — declare which fields are translatable in one line
- Five DRF serializers covering all read/write translation patterns (optional)
- `TranslationInline` for managing translations in the Django admin
- Management commands to export/import `.po` files 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

```bash
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
```

```python
# models.py
from django_localekit.models import TranslatableModel

class Article(TranslatableModel):
    title = models.CharField(max_length=200)
    body = models.TextField()
    translatable_fields = ["title", "body"]
```

```python
# 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/](https://alexivanchyk.github.io/django-localekit/)**

- [Installation](https://alexivanchyk.github.io/django-localekit/installation/)
- [Usage](https://alexivanchyk.github.io/django-localekit/usage/)
- [Serializers](https://alexivanchyk.github.io/django-localekit/drf/serializers/)
- [Commands](https://alexivanchyk.github.io/django-localekit/commands/)
- [Translation Providers](https://alexivanchyk.github.io/django-localekit/providers/)
- [Development](https://alexivanchyk.github.io/django-localekit/development/)

## Contributing

Pull requests are welcome. For major changes, please open an issue first.

## License

[MIT](https://choosealicense.com/licenses/mit/)

