This module offers Drush commands and a service to add translations for singular and plural strings within your Drupal site. It allows for manual translation input and can also be integrated into update or deployment hooks for automated translation management.
This module provides a drush command and a service to add UI translations.
Drush
Add a single 'singular' string translation:
drush tsi "example" "Beispiel" "de"
Add a single 'plural' string translation:
drush tpi "1 example" "1 Beispiel" "@count examples" "@count Beispiele" "de"
TSI Service
You can also use the tsi.service to add translations. For example in a update or deploy hook:
\Drupal::service('tsi.service')->addTranslation('example', 'Beispiel', 'de');
\Drupal::service('tsi.service')->addPluralTranslation('1 example', '1 Beispiel', '@count examples', '@count Beispiele', 'de', '');
To import multiple strings you can use:
$translations = [
'cat' => 'Katze',
'dog' => 'Hund',
];
\Drupal::service('tsi.service')->addMultipleTranslation($translations, 'de');
Ask your assistant about Translation String Import
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
- locale Drupal core
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.
Activity
Release Timeline
Releases
| Version | Type | Core | PHP | Release date | |
|---|---|---|---|---|---|
| 1.0.1 | Stable | 10–11 | Jun 17, 2026 | ||
| 1.0.0 | Stable | 10–11 | Apr 14, 2025 | ||
| 1.0.0-beta2 | Pre-release | 10–11 | Nov 22, 2024 | ||
| 1.0.x-dev | Dev | 10–11 | Nov 22, 2024 | ||
| 1.0.0-beta1 | Pre-release | 8–10 | PHP >=8.1 | Jun 30, 2023 | |
| 1.0.0-alpha1 | Pre-release | 8–10 | PHP >=8.1 | Mar 31, 2023 |