Translator plugin implementing DeepL for the Translation Management Tools (TMGMT) project. Allows to use machine translation provided by DeepL to translate content.

This module requires a DeepL API subscription. See https://www.deepl.com/pro#developer for more information about plans and pricing.

The project of course also supports implicitly all the features which are provided by TMGMT like a feature-rich review process, being able to translate different sources and more.

Features

  • Fast automated translation of content using the DeepL API - both endpoints (api-free.deepl.com and api.deepl.com) are supported, the endpoint is derived automatically from your API key
  • translate one or multiple nodes by a few simple mouse clicks
  • use advanced translation jobs management tool to submit and review translations
  • use DeepL multilingual glossary functionality to specify how words and phrases are translated in specific language combinations - including fetching existing glossaries from DeepL and CSV import/export of glossary dictionaries
  • support for document translation - thx @idebr (>= 2.3.0)
  • support for translation context for translation jobs (>= 2.3.0)
  • support for the key module (>= 2.3.0)
  • use of deepl-php library (>= 2.3.0)
  • selectable DeepL translation model (latency_optimized / prefer_quality_optimized) and tag handling version (v1 / v2) (>= 2.3.0)

New in 2.4.0

  • DeepL setup page at /admin/tmgmt/translators/deepl-setup that guides you through environment checks, API keys, recommended settings, glossaries and a test translation (see below)
  • Upgrade assistant for sites coming from 2.2.x - pre-flight checks before the database updates, guided migration of keys and settings, custom code scan and drush tmgmt-deepl:upgrade-status for deployment pipelines
  • supported languages are derived from the DeepL API (cached) instead of a hardcoded map - e.g. Traditional Chinese (zh-hant) and Latin American Spanish (es-419) are now translated correctly
  • glossary languages and valid language pairs are derived from the DeepL API as well
  • formality and tag handling are only sent for target languages that support them
  • configurable number of texts per DeepL API request (default raised to 20)
  • non-blocking document translation in the cron queue worker
  • interrupted document translations are resumed using the stored DeepL document handle, so a document is not billed twice
  • DeepL API failures are classified (configuration/authorization, quota exceeded, missing glossary, permanent and temporary errors such as rate limits) and handled accordingly instead of silently continuing - failed text chunks are reported in job messages and logs
  • billed characters, detected source languages and the model type used are shown after a translation
  • translations are saved in batch operations to avoid exceeding memory or execution time limits on large jobs
  • optional logging of DeepL API requests (and retries) to the dedicated tmgmt_deepl logger channel
  • safer glossary sync: local glossaries without a DeepL ID are linked to matching glossaries on DeepL, translators without an API key are skipped
  • compatibility with Ultimate Cron

Requirements

2.4.x

  • Drupal core ^11.4
  • PHP 8.4 or newer
  • packages mentioned below

2.3.x

DeepL currently offers the API Developer, API Growth and Enterprise API plans. The former DeepL API Free (500.000 characters per month) and DeepL API Pro plans can no longer be purchased, but existing subscriptions keep working with this module.

Installation

The module has to be installed via composer, so the deepl-php library and all module dependencies are available:

composer require drupal/tmgmt_deepl
drush en tmgmt_deepl

Optionally enable the glossary submodule:

drush en tmgmt_deepl_glossary

Configuration

The easiest way is the DeepL setup page at /admin/tmgmt/translators/deepl-setup

Manual configuration (<= 2.4.0)

  • add a new key of type DeepL API Key at /admin/config/system/keys/add and store your DeepL API authentication key there
  • add a new translation provider at /admin/tmgmt/translators
  • choose the DeepL API provider plugin and select your DeepL API authentication key (if no key is visible here, check for correct key type)
  • set additional settings related to DeepL and save the translator
  • if tmgmt_deepl_glossary is enabled, glossaries are managed at /admin/tmgmt/deepl_glossaries - grant the DeepL glossary permissions at /admin/people/permissions to the relevant roles

DeepL setup page (>= 2.4.0)

The setup page at /admin/tmgmt/translators/deepl-setup (permission administer tmgmt) guides you through the setup on any site - new installations as well as upgraded ones. It is linked from the Providers overview, the translator edit form and the status report. Its steps:

  1. Environment - checks the deepl-php library, the Key module and pending database updates
  2. API keys - lists your DeepL translators and their keys, and creates a Key module key or picks an existing one for each translator without a valid key (creating keys needs the administer keys permission)
  3. Settings - shows the recommended values (HTML tag handling, tag handling version v2, the translation model prefer_quality_optimized that v2 needs, language mappings for your site's languages, 20 texts per request) and applies them with Apply recommended settings and continue. On upgraded sites the settings before and now are shown next to the recommendation, and Keep current settings and continue leaves them as they are
  4. Glossaries - optionally syncs glossaries with DeepL when tmgmt_deepl_glossary is enabled (needs the Administer DeepL glossary entities permission)
  5. Custom code (upgrades from 2.2.x only) - scans other modules for classes and methods that were removed
  6. Test - on sites using config sync, lists key and translator configuration that is not exported yet; then runs a test translation

Upgrading from 2.2.x to 2.4.x

Update straight from 2.2.x to 2.4.x - do not stop at 2.3.x. The 2.4.x branch contains the upgrade assistant that safely migrates your translators and glossaries.

The DeepL API Free (deepl_free) and DeepL API Pro (deepl_pro) translator plugins have been removed and are replaced by the single DeepL API (deepl_api) plugin, which supports both endpoints. The database updates rewrite existing translators to the new plugin, and the DeepL setup page guides you through the rest. API keys are always stored with the Key module (type DeepL API Key), no longer in the translator settings.

Steps

  1. update the module via composer to get all dependencies:
    composer require drupal/tmgmt_deepl:^2.4
  2. run the database updates with drush updb (or visit update.php). A pre-flight check blocks the updates and explains what is missing, for example the deeplcom/deepl-php library or the Key module, and warns about API keys still stored in plain text in the translator settings
  3. open the DeepL setup page at /admin/tmgmt/translators/deepl-setup. It creates or reuses Key module keys for your translators, shows your previous settings next to the recommended ones, syncs glossaries, scans custom code for removed APIs and ends with a test translation and Finish upgrade
  4. until the upgrade is finished, a warning on the Providers overview names translators without a key and steps that still need a look; the translator edit form notes a missing key
Since December 2025, we (undpaul) have been listed as an official DeepL partner. Therefore, we send a partner ID (deepl-partner-integration-undpaul) within the User-Agent header. If this is not desired, the setting can be deactivated in the translation plugin.

Sponsors

Development on TMGMT DeepL Integration is sponsored by undpaul.

Supporting organizations: 
Development

Project information

Releases