Drupal is a registered trademark of Dries Buytaert
drupal 10.6.11 Update released for Drupal core (10.6.11)! drupal 11.3.12 Update released for Drupal core (11.3.12)! drupal 11.2.14 Update released for Drupal core (11.2.14)! drupal 10.5.12 Update released for Drupal core (10.5.12)! cms 2.1.3 Update released for Drupal core (2.1.3)! drupal 10.5.11 Update released for Drupal core (10.5.11)! drupal 11.3.11 Update released for Drupal core (11.3.11)! drupal 11.2.13 Update released for Drupal core (11.2.13)! drupal 10.6.10 Update released for Drupal core (10.6.10)! cms 2.1.2 Update released for Drupal core (2.1.2)! drupal 11.1.10 Update released for Drupal core (11.1.10)! drupal 10.5.10 Update released for Drupal core (10.5.10)! drupal 10.4.10 Update released for Drupal core (10.4.10)! drupal 11.2.12 Update released for Drupal core (11.2.12)! drupal 11.3.10 Update released for Drupal core (11.3.10)! drupal 10.6.9 Update released for Drupal core (10.6.9)! drupal 10.6.8 Update released for Drupal core (10.6.8)! drupal 11.3.9 Update released for Drupal core (11.3.9)! drupal 11.3.8 Update released for Drupal core (11.3.8)! drupal 11.3.7 Update released for Drupal core (11.3.7)!

Development helper for translation management

When developing a multilingual site, you might want to add new translatable strings and their translations in a hook_update_N(), hook_post_update_NAME(), Drush's hook_deploy_NAME(), or hook_install().

This module adds a service that can help you with that:

function hook_post_update_NAME(&$sandbox) {
  $tt = \Drupal::service('translate_tool');

  $tt->add('horse', 'da', 'hest');
  $tt->delete('horse');'
}

Or if you prefer a procedural interface (update and install hooks are procedural anyway):

function hook_post_update_NAME(&$sandbox) {
  translate_tool_add('horse', 'da', 'hest');
  translate_tool_delete('horse');'
}

You can also add a context:

function hook_post_update_NAME(&$sandbox) {
  $tt = \Drupal::service('translate_tool');

  $tt->add('horse', 'da', 'hest', 'my-context');
  $tt->delete('horse', 'my-context');'
}

Using context in a procedural style:

function hook_post_update_NAME(&$sandbox) {
  translate_tool_add('horse', 'da', 'hest', 'my-context');
  translate_tool_delete('horse', 'my-context');'
}

The default context is used if you don't specify one yourself.

Activity

Total releases
2
First release
Jun 2026
Latest release
23 hours ago
Release cadence
0 days
Stability
50% stable

Releases

Version Type Release date
2.2.x-dev Dev Jun 17, 2026
2.2.0 Stable Jun 17, 2026