Skip to main content

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

Project description

translatebot-django

PyPI Tests Coverage License: MPL 2.0

Python Django

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

Documentation: https://translatebot.dev/docs/

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:

python manage.py translate --target-lang fr

Features

  • Multiple AI Providers: OpenAI, Anthropic, Google Gemini, Azure, and many more
  • Smart Translation: Preserves placeholders (%(name)s, {0}, %s) and HTML tags
  • Model Field Translation: Supports django-modeltranslation
  • Flexible Configuration: Django settings, environment variables, or CLI arguments
  • Well Tested: 100% code coverage

Installation

pip install translatebot-django

Quick Start

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

TRANSLATEBOT_API_KEY = "your-api-key-here"
# 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/

Contributing

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

# 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 file for details.

Credits

  • Built with LiteLLM for universal LLM provider support
  • Uses polib for .po file manipulation

Made with ❤️ for the Django community

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

translatebot_django-0.3.5.tar.gz (27.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

translatebot_django-0.3.5-py3-none-any.whl (18.4 kB view details)

Uploaded Python 3

File details

Details for the file translatebot_django-0.3.5.tar.gz.

File metadata

  • Download URL: translatebot_django-0.3.5.tar.gz
  • Upload date:
  • Size: 27.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for translatebot_django-0.3.5.tar.gz
Algorithm Hash digest
SHA256 c20cfb09d06feabf29cb34c5bd041c55c570ea40712f5cee40e7f2caf4a2b06d
MD5 160082beb477a59dc46c5f6b8543f9f4
BLAKE2b-256 7fe8b7ff21f2b58bf980d8bb21dd4e3ed2519df565c975dda08c5d99427a2011

See more details on using hashes here.

Provenance

The following attestation bundles were made for translatebot_django-0.3.5.tar.gz:

Publisher: publish.yml on gettranslatebot/translatebot-django

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file translatebot_django-0.3.5-py3-none-any.whl.

File metadata

File hashes

Hashes for translatebot_django-0.3.5-py3-none-any.whl
Algorithm Hash digest
SHA256 e3bbdf5a1abe0b9403ca58a9c3eade56e6801fbcac271f75690eaa4011b20bd5
MD5 5c2bc2daecf67463caec21336dafc020
BLAKE2b-256 8523c938ef80c73fb5f8d38c36f6e6db74d3a4766d6b3732d37d0fc352b4d06a

See more details on using hashes here.

Provenance

The following attestation bundles were made for translatebot_django-0.3.5-py3-none-any.whl:

Publisher: publish.yml on gettranslatebot/translatebot-django

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page