Skip to main content

entirius-django-contentdb-translator

A Django module that translates the CMS content of Entirius, the open-source modular ecommerce platform. It extracts translatable text from ContentDB pages, navigation and authors, sends it to an AI toolbox service over HTTP and creates a new draft per language.

PyPI Python License: MPL-2.0

What it does

  • Translates pages (tiles, SEO meta, extensions, routes), navigation and author profiles.
  • Creates each language version as a separate draft, with channels, authors, routes and content sets copied.
  • Estimates the cost first: every translate call accepts dry_run and returns an estimate without translating.
  • Runs translation as toolbox jobs that a Celery task polls and applies when they finish.
  • Records which draft is the translation of which (TranslationLink), and can publish the result at once.
  • Exposes an admin API (JWT, Pydantic schemas, OpenAPI) and the commands translate_content and backfill_translation_links.

Installation

uv add entirius-django-contentdb-translator
pip install entirius-django-contentdb-translator
INSTALLED_APPS = [
    # ...
    "django_contentdb",
    "django_regional",
    "django_utils",
    "django_utils_translator",
    "django_contentdb_translator",
]

# main/urls.py
urlpatterns.append(path("", include("django_contentdb_translator.urls")))

The module needs a reachable AI toolbox service, configured through AI_TOOLBOX_BASE_URL and AI_TOOLBOX_API_KEY of entirius-django-utils; the channel idx of a call is sent as the toolbox channel. The toolbox itself is not part of this package. Settings reference: https://github.com/entirius/entirius-django-utils/blob/develop/docs/toolbox-client.md

Quick start

from django_contentdb_translator.services.translator import translate_draft

estimate = translate_draft(
    channel_idx="my-channel",
    draft_uid="<draft uid>",
    target_languages=["it"],
    dry_run=True,
)

With dry_run=True the call returns a cost estimate; without it a toolbox job is created and applied by the Celery task. The admin API is mounted under api/contentdb-translator/v2/admin/<shop_idx>/. The same orchestrator backs manage.py translate_content.

Requirements

  • Python 3.11 or newer, Django 5.0 or newer.
  • PostgreSQL (through entirius-django-contentdb) and a Celery worker.
  • A reachable AI toolbox service (AI_TOOLBOX_* settings).
  • Entirius packages pulled in: entirius-django-contentdb, entirius-django-regional, entirius-django-utils, entirius-django-utils-translator.

Documentation

Part of Entirius

This module runs inside the Entirius backend service (Volkanos) next to the ContentDB module it translates.

Development

make install     # sync dependencies (uv, incl. extras)
make check       # lint + format check (ruff)
make test        # test suite (pytest + pytest-django)

Development and agent instructions: https://github.com/entirius/entirius-django-contentdb-translator/blob/develop/AGENTS.md

License

Mozilla Public License 2.0 (MPL-2.0) — see https://github.com/entirius/entirius-django-contentdb-translator/blob/develop/LICENSE.

Metadata

Release files for entirius-django-contentdb-translator 2.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for entirius-django-contentdb-translator 2.1.0
File Size Uploaded
entirius_django_contentdb_translator-2.1.0.tar.gz 146.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for entirius-django-contentdb-translator 2.1.0
File Interpreter ABI Platform
entirius_django_contentdb_translator-2.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 191.0 kB

Release files / entirius_django_contentdb_translator-2.1.0.tar.gz

Download URL entirius_django_contentdb_translator-2.1.0.tar.gz
Size 146.1 kB
Tags Source
SHA-256 checksum
How to use checksums
70bb1f650438af42bb735c5f15a955dc12317fc1c85080835dcb6a3830e0a85d
BLAKE2b-256 checksum
How to use checksums
f1b191f87e7ea7bf57a427550f0f9ae2026a64bb7c470b41c5c42aeae7761303
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / entirius_django_contentdb_translator-2.1.0-py3-none-any.whl

Download URL entirius_django_contentdb_translator-2.1.0-py3-none-any.whl
Size 45.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
61a6b0e8f01878e5a6c124bacfe53fd48f8f20d76bca56768efb3f5fb5eaa3ff
BLAKE2b-256 checksum
How to use checksums
d73b50d45ba1d88b49a229aff3596e0bb13e769dc8a7d3e234efa031b17d2f2f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

2.1.0 This release

2 release files

2.0.1

2 release files

2.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page