Units, segments, formats and kinds¶
Units¶
A unit is one translatable object on your site. Connectors choose its external_key, which
must stay the same for the object’s whole lifetime and match ^[A-Za-z0-9_.:-]{1,255}$.
Adapter |
Unit |
Example |
|---|---|---|
|
a django CMS page content in the source language |
|
|
a Wagtail page |
|
|
a django-parler model instance |
|
|
a django-modeltranslation model instance |
|
Segments¶
A segment is one translatable field value inside a unit. Its key must be stable and unique
within the unit. Good keys identify what the text is, not where it is in a list:
Content |
Example |
|---|---|
A model field |
|
A django CMS plugin field |
|
A StreamField block |
|
position and parent_key describe the structure, for example a plugin tree or nested
blocks, so a connector can rebuild it in the target language. Changing them doesn’t make
translations stale.
Formats¶
|
Use for |
Whitespace in fingerprints |
QA checks HTML |
|---|---|---|---|
|
Plain text (the default) |
Line breaks count |
No |
|
Markdown |
Line breaks count |
No |
|
HTML fragments, e.g. djangocms-text |
Collapsed |
Yes |
|
Rich text stored as HTML, e.g. Wagtail rich text |
Collapsed |
Yes |
Results have the same format as their source segment.
Kinds¶
kind is a free-form hint of up to 50 characters. Ponyglot uses it in prompts and QA. These
values have an effect:
|
Effect |
|---|---|
|
SEO warning above 160 visible characters, unless the segment has |
|
SEO warning above 60 visible characters, unless the segment has |
|
An empty translation is reported as an empty alt text. |
Other common values are title, body and link_text. Send them anyway: they help the LLM
choose the right register and length.
Lengths¶
Set max_length when the target field has a length limit, for example a CharField. A
translation longer than that is a QA error and isn’t delivered.