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.0.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.0.0-py3-none-any.whl (91.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django_live_translations-1.0.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.0.0.tar.gz
Algorithm Hash digest
SHA256 92d46aa4b84878ea0b38adfb5a5d5783edff9e040e3507e99b589f960f5b504d
MD5 d37bde65fbb4d8b9826c3b2d2f5f389a
BLAKE2b-256 1ee11cffeb479b8d49287d79b381cbf04bddf7bc2d6315308a70b5b82e6759bf

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for django_live_translations-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 87cf9bd7455bf1b402227f09dc2a4b57591916fb0a04137a6c2663f4d66dab16
MD5 4b026bac457173b2e26ab920e6b97728
BLAKE2b-256 a27833694cf5236fc5bcca974268d745ae3e4924755c2a0cc2107ad64568dbdf

See more details on using hashes here.

Provenance

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