Part of the Tmgmt ecosystem · 55 projects
This module allows you to manage the entire translation workflow for Drupal content directly from the command line using Drush. It enables bulk staging of entities for translation, sending them to providers, importing completed translations, and accepting them, all without needing to use the graphical user interface.
TMGMT Drush Helper runs the whole Translation Management Tool (TMGMT) workflow in bulk from the command line. You can find what still needs translating, stage it in jobs, send the jobs to a provider, import and accept the translations, and clean up afterwards, without clicking through hundreds of jobs in the UI.
It does not use the TMGMT cart. The cart keeps its contents in the browser session, which a Drush process cannot see. The module creates real TMGMT jobs with job items instead, so they appear right away at /admin/tmgmt/jobs.
Features
- Find untranslated content:
tmgmt:scan-untranslatedreports, for each entity type, bundle and language, what has no translation, what content_translation flags as outdated, and what is already waiting in a job. It covers nodes, taxonomy terms, media, menu links, custom blocks (block library and Layout Builder inline blocks) and webforms. - Stage content in bulk:
tmgmt:job-batch-addcreates jobs for any translatable content entity type, for webforms and other config entities (withtmgmt_config), and for interface strings (withtmgmt_locale). It can:- queue only what is untranslated (
--missing-only); - skip content already in a job (
--skip-existing); - also queue the taxonomy terms and Layout Builder blocks a page references (
--include-references); - split the work into jobs of a set size (
--items-per-job).
- queue only what is untranslated (
- Exclusion list: a settings page lets administrators exclude entity types or bundles. The scan and
--missing-onlythen leave them out. - Assign providers:
tmgmt:job-updatesets the provider and its settings on jobs that have not been submitted, including jobs whose provider no longer exists. - Submit to any provider:
tmgmt:job-submit-allsubmits pending jobs and takes the provider's checkout settings as JSON. - Lionbridge support: the optional
tmgmt_helper_contentapisubmodule integrates with the Lionbridge Translation Provider:tmgmt:job-submit-lionbridgesends jobs with their Lionbridge settings: provider, due date, PO reference, quote, analysis codes and export format.--resubmitsends again jobs that Lionbridge never received.tmgmt:job-importfetches finished translations from the Lionbridge Content API.- A "LionBridge Job ID" column is added to the jobs overview.
- Deleted jobs are removed from the Lionbridge send queues, so they no longer stop cron.
- Accept and finish:
tmgmt:job-accept-allaccepts imported translations.tmgmt:job-finish-acceptedmoves fully accepted jobs to Finished. It can also abort items whose source content was deleted.
- Clean up:
tmgmt:job-delete-alldeletes jobs by state, owner or ID. It aborts active jobs with their provider first. - Links to the source: on a job's page, each job item links to the content being translated, if it still exists and you can view it.
- Safe to try: every command supports
--dry-run.
Typical workflow
# See what still needs translating. drush tmgmt:scan-untranslated --target-langcodes=es,fr # Stage what is untranslated, with the terms and blocks it references. drush tmgmt:job-batch-add node --target-langcodes=es,fr --missing-only --skip-existing --include-references # Send the jobs (tmgmt:job-submit-all for providers other than Lionbridge). drush tmgmt:job-submit-lionbridge --provider=my_provider # Once the provider has finished, import and accept the translations. drush tmgmt:job-import drush tmgmt:job-accept-all
Requirements
- Drupal 10.3 or later, or Drupal 11
- PHP 8.3 or later
- Drush 13.7 or later
- Translation Management Tool, including Content Entity Source (
tmgmt_content)
Recommended modules
- Lionbridge Translation Provider: needed by the
tmgmt_helper_contentapisubmodule. All other commands work with any TMGMT provider. - TMGMT's Config Entity Source (
tmgmt_config): to queue webforms and other config entities. - TMGMT's Locales Source (
tmgmt_locale): to queue interface strings. - Layout Builder and Paragraphs:
--include-referencesfollows the blocks and terms they reference.
Installation and configuration
composer require drupal/tmgmt_helper drush en tmgmt_helper # Lionbridge only: drush en tmgmt_helper_contentapi
To exclude entity types or bundles from the scan and from --missing-only, go to Administration » Translation » Settings » Drush helper. This needs the "administer tmgmt" permission. Run drush help <command> for every option, and see the README for full documentation.
Security
The Drush commands bypass entity access checks so they can work on all content. Limit who can run Drush on your servers.
Ask your assistant about TMGMT Drush Helper
Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works
Depends on
Dependencies of the latest stable release
- Translation Management Tool
- Translation Management Tool tmgmt_content
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.