Skip to content

Django Traduire

Auto-translate django-modeltranslation fields — long articles and rich text included.


The problem

You use django-modeltranslation to manage multilingual content. For each translatable field, it creates language-specific columns: title_fr, title_de, title_en, title_it...

But you develop in one language. Your content editors write in one language. The other columns stay empty.

Manually translating every field, for every model, in every language is tedious and error-prone. And the moment the content is a real article — three thousand words, headings, lists, a bold sentence — a naive call to a translation API gives you back a truncated paragraph with its tags stripped.

The solution

django-traduire fills the gaps automatically, and knows what it is translating.

from django_traduire import translate_instance

article = Article.objects.get(pk=1)
# article.title_fr = "Bonjour le monde"

translate_instance(article)
# article.title_de = "Hallo Welt"
# article.title_en = "Hello world"
# article.title_it = "Ciao mondo"

Features

  • No key to get started — the default backend is the free Google endpoint: pip install django-traduire and translate
  • Long texts — a field of any length is cut on paragraph, sentence, then word boundaries, and glued back exactly
  • Rich text — headings, sections, lists, tables, links and inline emphasis come back where they were; <code> and <script> are never sent
  • Pluggable backends — free Google, DeepL, Google Cloud, OpenAI, or write your own in one method
  • Batch translation — fields and languages are grouped into as few requests as the provider allows
  • Management command — python manage.py traduire to batch-translate existing data
  • Admin integration — "Translate" action in Django admin with one click
  • Auto-translate on save — optional, off by default
  • Non-destructive — only fills empty columns by default, and never overflows one
  • Zero config source detection — defaults to your LANGUAGE_CODE