This project is not covered by Drupal’s security advisory policy.

AI Translate Auto keeps a multilingual site translated without anyone pressing a button. It translates content into every site language on cron, translates it again when the original changes, and never overwrites a translation a person wrote. It is an extension of AI Translate: it uses its provider, its prompt and its field handling, and adds the automation around them.

What AI Translate does, and what this module adds

AI Translate adds a "Translate with AI" link to the Translate tab of each piece of content. An editor opens the content, clicks the link for one language, and waits for the translation. That works well for a handful of pages. It does not cover a site with thousands of items, content that arrives from importers, or originals that keep changing.

AI Translate Auto builds on it:

AI Translate With AI Translate Auto
How a translation starts By hand, one item and one language at a time On cron, for all the content of the bundles you turn on
When the original changes Nothing happens The translations the AI made are made again
Translations written by a person Not applicable Detected and never overwritten
Several languages at once One click per language All missing languages, on cron or from one form
Translating again an existing translation Not possible From the "AI translation" form, also over a manual one
Instructions for the AI One prompt for the site, or per language Extra style rules per bundle, added to that prompt
Originals in the wrong language or mixing languages Translated as they are Optionally rewritten first in the language of the content
Failures Shown to the editor Logged and tried again later, without blocking the rest

Features

  • Automatic translation on cron. Published content of the enabled bundles is translated into every language it lacks. Each cron run works for a configurable time and picks up where the last one stopped.
  • Translations that stay up to date. When the text of the original changes, the translations made by the AI are marked as outdated and made again.
  • Respect for human work. A translation written or edited by a person is never touched. The module records which translations the AI made, so it can tell them apart.
  • Settings per bundle. Each content type, vocabulary, media type, block type or paragraph type has its own section on its edit form: turn it on, choose whether cron translates it, set its weight, and write its instructions.
  • Order you decide. Bundles with a lower weight are translated first, for example vocabularies before the content that uses them.
  • Translation instructions per bundle. Style rules added to the translation prompt, for example "write as a native speaker would, do not add anything that is not in the original". They also apply to translations started by hand with AI Translate.
  • Optional rewrite of the original. For content that arrives in the wrong language, or with the same text repeated in several languages, the AI first rewrites the long text fields in the language of the content. If an importer saves the old text again, the rewritten text is kept.
  • On-demand translation. An "AI translation" tab on nodes and taxonomy terms, and a "Translate with AI" operation in the listings of any entity type. The form shows where each language stands and translates the chosen ones in one batch.
  • Works with the AI Translate link. Translations made with the "Translate with AI" link are tidied up and recorded as made by the AI, so they are also kept up to date.
  • Paragraphs and other nested content. Translate them on their own, one small translation each, or together with their page. Paragraphs that no page uses any more are skipped.
  • Failures do not block the queue. A failed translation is logged and tried again after a configurable time.
  • Drush command to work through a large backlog without waiting for cron: drush ai-translate-auto:run --seconds=3600.
  • Extensible. A query tag lets other modules keep content out of the automatic translation, for example sold products.

How it works

  1. You turn automatic translation on in the bundles you want, on the edit form of each bundle.
  2. On every cron run the module lists the translations to make: content without a translation in a language, and translations made by the AI whose original has changed since.
  3. It works through the list for the configured time. Each translation is one piece of content into one language, made with AI Translate, so every field type AI Translate supports is covered: plain and formatted text, summaries, link titles, image alternative text and titles, and file descriptions.
  4. It records each translation it makes together with a fingerprint of the original text. That record is how it later knows that the original changed, or that a person edited the translation.

The module sends content to the AI provider configured in the AI module. With a self-hosted provider, such as Ollama or a LiteLLM gateway in front of local models, nothing leaves your infrastructure.

Requirements

  • Drupal 10.3 or later, or Drupal 11.
  • AI, with a provider and a default model for the "Chat" and "Translate text" operations.
  • AI Translate.
  • Content Translation (Drupal core), enabled for the bundles to translate.
  • A working cron.

It supports entity types with a numeric ID whose bundles are configuration entities: content types, vocabularies, media types, block types, paragraph types and similar.

Installation and configuration

  1. Install the module with Composer: composer require drupal/ai_translate_auto, and enable it.
  2. Check that AI Translate works: translate one piece of content with its "Translate with AI" link.
  3. Open the edit form of a bundle, for example Structure » Content types » Article » Edit, and in "Automatic AI translation" tick "Translate automatically with AI".
  4. Optionally set the weight, the translation instructions and the rewrite of the original.
  5. Run cron. The settings shared by all bundles, such as the time per cron run and the wait before a retry, are at Configuration » AI » Automatic AI translation.

Coming from IA Translations

This module replaces IA Translations, which translated single fields with ChatGPT through the Prompt module. There is nothing to migrate: the translations it created are ordinary content and stay as they are. See the README for the steps.

Supporting organizations: 

Project information

Releases