Metadata-Version: 2.4
Name: translatebot-django
Version: 0.3.3
Summary: Stop copy-pasting to and from Google Translate. Translate your Django .po files automatically with AI.
Author: Bjorn the Builder
Author-email: bjornthebuilder@proton.me
License: MPL-2.0
Project-URL: homepage, https://translatebot.dev
Project-URL: documentation, https://docs.translatebot.dev
Project-URL: repository, https://github.com/gettranslatebot/translatebot-django
Project-URL: issues, https://github.com/gettranslatebot/translatebot-django/issues
Project-URL: changelog, https://translatebot.dev/docs/changelog/
Keywords: django,translation,i18n,localization,gettext,po,openai
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: Django
Classifier: Framework :: Django :: 4.2
Classifier: Framework :: Django :: 5.0
Classifier: Framework :: Django :: 5.1
Classifier: Framework :: Django :: 5.2
Classifier: Framework :: Django :: 6.0
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)
Classifier: Programming Language :: Python :: 3
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: Topic :: Software Development :: Internationalization
Classifier: Topic :: Software Development :: Localization
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: Django>=4.2
Requires-Dist: polib>=1.2.0
Requires-Dist: litellm>=1.80.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-django>=4.5.0; extra == "dev"
Requires-Dist: pytest-mock>=3.10.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Requires-Dist: ruff>=0.8.0; extra == "dev"
Requires-Dist: django-modeltranslation>=0.18; extra == "dev"
Provides-Extra: modeltranslation
Requires-Dist: django-modeltranslation>=0.18; extra == "modeltranslation"
Dynamic: license-file

# translatebot-django

[![PyPI](https://img.shields.io/pypi/v/translatebot-django.svg)](https://pypi.org/project/translatebot-django/) [![Tests](https://github.com/gettranslatebot/translatebot-django/actions/workflows/test.yml/badge.svg)](https://github.com/gettranslatebot/translatebot-django/actions/workflows/test.yml) [![Coverage](https://codecov.io/gh/gettranslatebot/translatebot-django/graph/badge.svg)](https://codecov.io/gh/gettranslatebot/translatebot-django) [![License: MPL 2.0](https://img.shields.io/badge/License-MPL_2.0-brightgreen.svg)](https://opensource.org/licenses/MPL-2.0)

[![Python](https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12%20%7C%203.13%20%7C%203.14-blue)](https://www.python.org/) [![Django](https://img.shields.io/badge/django-4.2%20%7C%205.x%20%7C%206.0-green)](https://www.djangoproject.com/)

**Stop copy-pasting to and from Google Translate.** Translate your Django `.po` files automatically with AI.

## The Problem

Maintaining translations in Django is painful:

- Opening `.po` files, copying to Google Translate, pasting back - repeat 200 times
- Placeholders like `%(username)s` get mangled and crash your app
- Source strings change, and now you need to update .po files for all 10 languages
- Hours spent on translations instead of building features

## The Solution

One command translates everything while preserving your Django placeholders:

```bash
python manage.py translate --target-lang fr
```

## Features

- **Multiple AI Providers**: OpenAI, Anthropic, Google Gemini, Azure, and [many more](https://docs.litellm.ai/docs/providers)
- **Smart Translation**: Preserves placeholders (`%(name)s`, `{0}`, `%s`) and HTML tags
- **Model Field Translation**: Supports [django-modeltranslation](https://github.com/deschler/django-modeltranslation)
- **Flexible Configuration**: Django settings, environment variables, or CLI arguments
- **Well Tested**: 100% code coverage

## Installation

```bash
pip install translatebot-django
```

## Quick Start

```python
# settings.py
INSTALLED_APPS = [
    # ...
    'translatebot_django',
]

TRANSLATEBOT_API_KEY = "your-api-key-here"
```

```bash
# Translate to Dutch
python manage.py translate --target-lang nl

# Preview without saving
python manage.py translate --target-lang nl --dry-run
```

## Documentation

For full documentation, visit **[translatebot.dev/docs](https://translatebot.dev/docs/)**

- [Installation](https://translatebot.dev/docs/getting-started/installation)
- [Configuration](https://translatebot.dev/docs/getting-started/configuration)
- [Command Reference](https://translatebot.dev/docs/usage/command-reference)
- [Model Translation](https://translatebot.dev/docs/usage/model-translation)
- [Supported AI Models](https://translatebot.dev/docs/integrations/ai-models)
- [FAQ](https://translatebot.dev/docs/faq)

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

```bash
# Setup
git clone https://github.com/gettranslatebot/translatebot-django.git
cd translatebot-django
uv sync --extra dev

# Run tests
uv run pytest
```

## License

This project is licensed under the Mozilla Public License 2.0 - see the [LICENSE](LICENSE) file for details.

## Credits

- Built with [LiteLLM](https://github.com/BerriAI/litellm) for universal LLM provider support
- Uses [polib](https://github.com/izimobil/polib) for `.po` file manipulation

---

Made with ❤️ for the Django community
