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.1

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.1
File Size Uploaded Provenance Actions
entirius_django_contentdb_translator-2.1.1.tar.gz 148.1 kB Without provenance Details for entirius_django_contentdb_translator-2.1.1.tar.gz

Built distribution (wheel)

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

Total release size: 194.2 kB

Release files / entirius_django_contentdb_translator-2.1.1.tar.gz

Download URL entirius_django_contentdb_translator-2.1.1.tar.gz
Size 148.1 kB
Tags Source
SHA-256 checksum
How to use checksums
0096b44b8ab94f4cdd1de00f2220e89f705908a751805f7e7f9dbc1f51bc4fd7
BLAKE2b-256 checksum
How to use checksums
e2f09fcf8a2accceafcecdfac0df962b59d418668d0a053e34eac25f71ff3907
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","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.1-py3-none-any.whl

Download URL entirius_django_contentdb_translator-2.1.1-py3-none-any.whl
Size 46.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1bceff7780e03f35d8c23350e1cb3540f255457add5598b831e8f3455b423c0d
BLAKE2b-256 checksum
How to use checksums
c200e1d4e924b4ef08c3b220af13ff0dd909319291b19beeba9f807e20014f7c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","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}

Security for entirius-django-contentdb-translator 2.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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