Import existing translations¶
If your site is already multilingual, send its current translations with the first push. Ponyglot then starts from reality: it doesn’t translate what you already have, and your existing translations fill the translation memory.
Send translations with the snapshot¶
Add translations to each segment: a map from language code to the text in that language.
{
"external_key": "djangocms:page:42",
"adapter": "djangocms",
"label": "Pricing",
"segments": [
{"key": "title", "text": "Pricing", "kind": "title",
"translations": {"de": "Preise", "fr": "Tarifs", "it": "Prezzi"}},
{"key": "plugin:104:body", "text": "<p>€299 per month for 10 sites</p>", "format": "html",
"translations": {"de": "<p>299 € pro Monat für 10 Sites</p>"}}
]
}
The response counts them in imported_translations. The tutorial’s
pricing page is a complete
example.
What Ponyglot does with them¶
Imported translations are stored as approved, with origin
imported.They are assumed to match the current source. Ponyglot can’t know which version of the source they were made from.
They only fill languages that have no translation yet. Ponyglot never overwrites its own translations, drafts in review, or approved translations this way. You can send
translationswith every push; languages that are already filled are skipped.Empty texts are skipped.
Languages that aren’t target languages of the site, or of the unit when it sets
writable_languages, are ignored.Imported translations are added to the organization’s translation memory. The same sentence elsewhere is then translated from memory, free of charge.
Check for outdated translations¶
Because imports are assumed to be current, an outdated translation on your site looks
approved at first. It shows up as stale as soon as someone edits its source text. To
retranslate everything anyway, request a translate job with "force": true for the units in
question (see Request translations).
Import from another tool¶
To import a translation memory from a translation tool instead of from your site, use a TMX file: see Use the translation memory.