djangocms-ponyglot
django CMS connector for Ponyglot: translate any frontend-editable content (pages, posts, aliases, your own models) with glossary, translation memory and delta sync. With djangocms-versioning, translations arrive as drafts; nothing is published until an editor publishes it.
Early access, alpha. Requires Python 3.10+, django CMS 5.1+, Django 5.2+ and the
ponyglot core; djangocms-versioning 2.7+ is recommended. See https://ponyglot.app.
Install
pip install "djangocms-ponyglot[versioning]"
INSTALLED_APPS += [
"ponyglot",
"djangocms_ponyglot",
# "ponyglot.contrib.parler", # model fields translated with django-parler
]
PONYGLOT = {
"API_KEY": env("PONYGLOT_API_KEY"),
"SOURCE_LANGUAGE": "en",
}
python manage.py migrate
python manage.py ponyglot check
python manage.py ponyglot backfill # first push of all published content
Run python manage.py ponyglot sync periodically (cron, or --loop 60 as a worker).
What is translated
Every model registered for frontend editing (cms_toolbar_enabled_models in a cms_config.py),
e.g. cms.PageContent, djangocms-stories' PostContent, djangocms-alias' AliasContent and
your own content models. Limit them with DJANGOCMS["MODELS"].
A unit is the content's grouper (the page, the post, …). Two kinds of content types:
| One content object per language | All languages in one content object | |
|---|---|---|
| Recognised by | language is a versioning grouping field |
no language grouping |
| Examples | pages, posts, aliases | custom models whose plugins carry their language |
| Sent | content model fields (title, …) and plugin fields | plugin fields |
| Translation arrives as | a draft of that language's content (created if missing) | the target-language plugins in the object's draft |
| Published | per language | all languages together |
Content types without versioning get no automatic writes (writing would publish): translations wait until an editor chooses Apply, which writes them live.
Plugin fields come from each plugin's form, as editors see it in the plugin admin (its
own form or the generated model form, limited by fields/fieldsets, without exclude and
read-only fields). What editors type into is what gets translated:
- plain text fields (
forms.CharField), except hidden ones, those validated as a slug or by a pattern (identifiers, such as djangocms-form-builder's field names) and those named like identifiers, code, CSS selectors or classes, icons or anchors; - rich text fields (
HTMLFormField) as HTML; - in HTML attribute fields (djangocms-attributes-field), the attributes that hold prose:
alt,title,aria-label,aria-descriptionandplaceholder.
URL, slug, email, choice, link and attribute fields drop out by their form field type. This
covers djangocms-frontend: its entangled forms store texts in the config JSON field
(config.heading, config.quote_content, config.name, …), which are read and written in
place, as are the alt texts and titles in each plugin's "Advanced settings" attributes
(config.attributes.alt; the image plugin's alt text lives there). Code blocks, heading ids,
CSS classes and link targets aren't touched. Links embedded in rich text
(djangocms-link's LinkPlugin, djangocms-frontend's TextLinkPlugin) are translated inside
their sentence.
djangocms-translations' declarations win, so an existing DJANGOCMS_TRANSLATIONS_CONF works as
is:
DJANGOCMS_TRANSLATIONS_CONF = {
"TextPlugin": {"fields": ["body"]},
"LinkPlugin": {"fields": ["name"], "text_field_child_label": "name"},
"PicturePlugin": {"fields": ["caption_text"]},
}
fields: exactly these fields;excluded_fields: leave these out. Names of JSON keys work ("heading"meansconfig.headingfor djangocms-frontend,"attributes.title"meansconfig.attributes.title), or dotted paths.text_field_child_label: for plugins embedded in rich text (links in djangocms-text), this field is translated inside the sentence it appears in and written back to the plugin.
A project already set up for
djangocms-deepl-translations
needs no second configuration: its DJANGOCMS_DEEPL_TRANSLATIONS_PLUGIN_CONFIG is read too.
translatable_fields ("config/accordion_item_header" or key tuples) become fields
(config.accordion_item_header), and no_translation: True translates nothing in that plugin.
Only the setting in your project is read; for plugins it doesn't list, the plugin forms decide.
If both packages' settings name a plugin type, DJANGOCMS_TRANSLATIONS_CONF wins.
To see what is translated, run python manage.py ponyglot_fields (optionally with plugin
type names, or --translated to leave out plugins without translated fields):
HeadingPlugin
config.heading
config.attributes (alt, title, aria-label, aria-description, placeholder)
TextLinkPlugin [config.name inside the text it's embedded in]
config.name
config.attributes (alt, title, aria-label, aria-description, placeholder)
Content model fields (one-object-per-language types): pages send title, menu title, page
title and meta description; other models their text fields except bookkeeping ones, or what
DJANGOCMS["CONTENT_FIELDS"] lists. A slug field follows the translated title.
How it works
-
Stable plugin keys: plugin ids change with every version, so plugins get keys that follow them across versions and languages. A translated plugin shares its source plugin's key. Content that is already translated is matched by structure (placeholder, plugin type, position in the tree), and its texts are imported on the first push.
-
Translate: Ponyglot translations is the first entry of the toolbar's Language menu on any translated content. It opens a dialog with this content's state per language and the next step for each: Translate, Apply to draft, Review draft (opens the translated draft to check and publish), or nothing when Ponyglot is reviewing it. When everything is translated it says so. If no sync round ran within
FETCH_AFTER_MINUTES, opening the dialog fetches this content's translations first (and pushes it if it changed). Large jobs ask for confirmation first. -
Status details: the dialog links to the full status page: per segment (✓ / stale / in review / missing / waiting for QA), jobs and the plugin tree copy.
-
Source: the dialog translates the version you're viewing, draft or published; it says which.
-
Drafts: a unit arrives in one piece per language. A draft this connector wrote and nobody touched is updated; a published version gets a new draft (only changed texts are updated, so earlier corrections stay); a draft someone edited is never overwritten. The menu entry shows "n to review" for languages with a draft or translations waiting.
-
Approve: publishing reports the approval, including your corrections (they go into the translation memory). Discarding or archiving a delivered draft reports a rejection.
-
Source structure changes are merged into the translations (three-way: the source tree at the last delivery, the source now, the translation now):
- added plugins are copied in at the same place, with their children, together with their translations (right away if they have no texts, e.g. an image);
- moved plugins (to another parent or another order) are moved, unless an editor moved them in the translation too: the editor's place wins;
- deleted plugins are listed in the dialog, Delete here too or Keep; never deleted without confirmation;
- plugins an editor removed from or added to a translation stay as they are.
Moves and plugins without texts bring no new texts to translate, so publishing the source merges them right away (a new draft of each translation that has none an editor edited); content with all languages in one object merges with the next delivery.
-
Existing translations: a language translated before Ponyglot is matched plugin by plugin: same placeholder, plugin type and position in the tree. If all source plugins have a counterpart, translations go into it (a new draft of it). If not, nothing is written until an editor chooses in the dialog: Add to existing language (keeps its plugins, fills in the translations where plugins match, in its draft or a new draft of it; texts without a counterpart keep waiting) or Start from source language (a draft with a translated copy of the source plugins). Either way, the published version stays until the draft is published.
-
Different structure: texts without a counterpart in the translated plugin tree (e.g. a plugin an editor removed from the translation) keep waiting and are listed with Copy plugin tree from source.
-
QA: depending on your plan, QA errors are shown next to the texts for editors to fix, or held back for a separate review; the status lists what is waiting and why.
-
Exclude: keep content out of translation, for all or some languages.
Publish right away
In the toolbar dialog and the status page, editors who may publish the content (djangocms-
versioning's publish permission) can tick Publish the translation right away before
translating (PONYGLOT["PUBLISH_BY_DEFAULT"] pre-ticks it). The translation is then written
into a draft as usual and published in the editor's name, if no QA error was found and the
draft holds only these translations. Only for content types with one content object per
language (pages, posts): shared content would publish every language at once. Otherwise the
draft waits for review, and the sync report says why.
Settings
In PONYGLOT["DJANGOCMS"] (the core's settings apply too, see the ponyglot README):
| Key | Default | |
|---|---|---|
MODELS |
all frontend-editable models | e.g. ["cms.pagecontent", "djangocms_stories.postcontent"] |
CONTENT_FIELDS |
see above | e.g. {"djangocms_stories.postcontent": ["title", "abstract"]} |
PLUGINS |
– | like DJANGOCMS_TRANSLATIONS_CONF; these entries win over it and DJANGOCMS_DEEPL_TRANSLATIONS_PLUGIN_CONFIG |
USER |
"ponyglot" |
username of the (inactive) user that authors translation drafts |
FETCH_AFTER_MINUTES |
15 |
without a sync round this long, the dialog fetches its content's translations itself |
Not yet supported
- Choosing email recipients per content object (the core's
NOTIFY_EDITORSapplies site-wide).
Development
make install # uv sync (the core from ../ponyglot)
make check # ruff, migrations check, tests (SQLite)
The tests cover every combination: versioned and unversioned content types, each with one content object per language and with all languages in one object (pages and a custom model; a shared-language model; an unversioned per-language model; an unversioned model without a grouper), including the toolbar on each. Design: docs/decisions. License: BSD-3-Clause.
Metadata
Release files for djangocms-ponyglot 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| djangocms_ponyglot-0.1.0.tar.gz | 46.6 kB | With provenance | Details for djangocms_ponyglot-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| djangocms_ponyglot-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for djangocms_ponyglot-0.1.0-py3-none-any.whl |
Total release size: 103.7 kB
Release files / djangocms_ponyglot-0.1.0.tar.gz
| Download URL | djangocms_ponyglot-0.1.0.tar.gz |
|---|---|
| Size | 46.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dd1847da3365b6b8c8907ffff2119d05916140f7bf4352435e51b75125e4eb11
|
|
BLAKE2b-256 checksum How to use checksums |
fc3580e9435710fdf915f9d9914aa84f448048495c52f781c7166b92d0b21351
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.
Transparency logRelease files / djangocms_ponyglot-0.1.0-py3-none-any.whl
| Download URL | djangocms_ponyglot-0.1.0-py3-none-any.whl |
|---|---|
| Size | 57.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d8f07edf392b34edc899d1542e7e479cc7821822759b88a6e9cb7d36616e4723
|
|
BLAKE2b-256 checksum How to use checksums |
0149d49361e880d5334a732031d813c782ced337f39de5ce449d960fd5a53831
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.
Transparency logSecurity for djangocms-ponyglot 0.1.0
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for djangocms_ponyglot-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.
Transparency logA 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.