Keep content out of translation¶
This guide shows how to stop Ponyglot from translating some of your content: single objects, some languages of an object, whole models or single fields.
Single objects¶
In the admin, Ponyglot › Sync states lists everything the connector syncs. Select the objects and choose the action Exclude from translation. The next sync removes them from Ponyglot, so they no longer count as missing and are never translated. Translate again undoes it; the next sync sends them again.
This works for django CMS content too. Its translations dialog then shows Not translated (excluded), and its status page (Details) can include it again.
Some languages only¶
To exclude an object from some languages, for example a page that exists only in English and German, edit its entry under Ponyglot › Exclusions from translation and choose the languages.
Whole models and fields¶
Exclude by setting, in the PONYGLOT setting:
PONYGLOT = {
# …
"EXCLUDE_MODELS": ["shop.InternalNote"],
"EXCLUDE_FIELDS": ["blog.Post.subtitle", "shop.Product.slug"],
}
Excluded models and fields are never sent. Excluding a slug field also stops Ponyglot from setting translated slugs for it (see How the connectors work).
django CMS content types and plugin fields¶
For django CMS, choose which content types and which plugin fields are translated with the
DJANGOCMS options: MODELS, CONTENT_FIELDS and PLUGINS (see
Connector settings). For example, to translate only pages and blog posts,
and only the caption of pictures:
PONYGLOT = {
# …
"DJANGOCMS": {
"MODELS": ["cms.pagecontent", "djangocms_stories.postcontent"],
"PLUGINS": {"PicturePlugin": {"fields": ["caption_text"]}},
},
}