Skip to main content

In-browser translation editing for Django superusers

Project description

django-live-translations

CI Python 3.12+ Django 4.2+ Docs

In-browser translation editing for Django superusers.

Edit translations directly on any page of your Django application. Toggle edit mode, click any translatable string, and save changes that take effect immediately - no deployment, no restarts, no context switching to .po file editors.

Live translation editing demo

Features

  • Inline editing - click any translatable string to open a multi-language editor
  • Live preview - changes appear on the page instantly after saving
  • Preview mode - review inactive translations before making them live
  • Draft language support - prepare translations for unpublished languages before going live
  • Edit history - word-level diffs with one-click restore
  • Bulk activation - select and activate multiple pending translations at once
  • Two storage backends - PO files (default) or database with cache-based sync
  • Custom permissions - control who can edit with a simple callable
  • Django admin integration - manage translation overrides from the admin panel
  • Zero frontend dependencies - vanilla JS widget, no build step required
Translation editor modal with language tabs

Quick start

pip install django-live-translations
# or
uv add django-live-translations
# or
poetry add django-live-translations
# settings.py
INSTALLED_APPS = [
    # ...
    "django.contrib.staticfiles",
    "live_translations",
]

MIDDLEWARE = [
    # ...
    "django.contrib.auth.middleware.AuthenticationMiddleware",
    "live_translations.middleware.LiveTranslationsMiddleware",  # after auth
    # ...
]

Log in as a superuser and press Ctrl+Shift+E to activate edit mode.

For the full setup guide, see the documentation.

Demo app

The repository includes a working example app:

git clone https://github.com/vojtechpetru/django-live-translations
cd django-live-translations
pip install -e ".[dev]"
cd example
python manage.py migrate
python manage.py runserver

Open localhost:8000 and click "Quick Login" to auto-create a superuser.

Compatibility

Python Django
3.12, 3.13, 3.14 4.2, 5.0, 5.1, 5.2, 6.0

Contributing

Contributions are welcome! Here's how to get started:

Setup

git clone https://github.com/vojtechpetru/django-live-translations
cd django-live-translations
uv sync --all-extras
pre-commit install

Development commands

This project uses just as a task runner:

just unit          # run unit tests
just e2e           # run e2e tests (both backends)
just e2e-po        # run e2e tests (PO backend only)
just e2e-db        # run e2e tests (DB backend only)
just bench         # run performance benchmarks
just demo          # start the example app
just docs-serve    # serve docs locally

Code quality

The project enforces strict quality standards through pre-commit hooks and CI:

  • Formatting: ruff format (120 char line length)
  • Linting: ruff check
  • Type checking: pyrefly
  • Test coverage: 90%+ required
  • Test suite: 650+ unit tests, 290+ Playwright e2e tests

Pull requests

  1. Fork the repo and create your branch from main
  2. Add tests for any new functionality
  3. Ensure just test passes and coverage stays above 90%
  4. Make sure pre-commit hooks pass (ruff, pyrefly)
  5. Open a pull request with a clear description of the change

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

django_live_translations-1.2.0.tar.gz (2.3 MB view details)

Uploaded Source

Built Distribution

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

django_live_translations-1.2.0-py3-none-any.whl (92.6 kB view details)

Uploaded Python 3

File details

Details for the file django_live_translations-1.2.0.tar.gz.

File metadata

  • Download URL: django_live_translations-1.2.0.tar.gz
  • Upload date:
  • Size: 2.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for django_live_translations-1.2.0.tar.gz
Algorithm Hash digest
SHA256 fb747cfbbfc7f35d094e1804e8f7af7f5991c04dc00cd0671b6242535a5f2f77
MD5 793e886b9fb95b78ffe255dd8f4bc23e
BLAKE2b-256 0c65fc29c9b97ba6ee217efb56fd92d82dccfa320e0399866ac56a3bebc04f30

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_live_translations-1.2.0.tar.gz:

Publisher: publish.yml on VojtechPetru/django-live-translations

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

File details

Details for the file django_live_translations-1.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_live_translations-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 92867a75fa9c4e522b1e58aa0e319a677b49be31ab8e7ab73d09b9289ad38efe
MD5 c934f420bf267aa797a20d9c812cf40f
BLAKE2b-256 76c0f52cd6aad8922a083bf0fcafa8f4f102da9a3beecf24ff00ed1223b8f68c

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_live_translations-1.2.0-py3-none-any.whl:

Publisher: publish.yml on VojtechPetru/django-live-translations

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