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.1.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.1.0-py3-none-any.whl (92.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django_live_translations-1.1.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.1.0.tar.gz
Algorithm Hash digest
SHA256 9e7b51179866f3c45114e90d1e179e449eb842e5eaad23078c7900cfd0329fe0
MD5 88cd3fa260d19e70e22253807482226f
BLAKE2b-256 b695f4c36f403806964817520cad401a714e4e142eff00ff3d32aecf74e7cb90

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_live_translations-1.1.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.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_live_translations-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a263566202aabdf100a5bcff57a732419a1a94c1bccdb73fb24fcca4cc428737
MD5 b40cc003b65758653a538c835306720f
BLAKE2b-256 d4c70e043f1eab9c58509fa45f8e1de590054ee6b48eaca035226ca0fe5a7b75

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_live_translations-1.1.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