Drupal 8/9/10

Translate your Drupal 8, Drupal 9 and Drupal 10 site using Transifex's plugin and TMGMT.

Nina avatar
Written by Nina
Updated over a week ago

Transifex's Drupal integration lets you translate your Drupal site using Transifex. It works as an add-on to the Translation Management Tool (TMGMT), a popular module for Drupal localization.

We assume the starting point is a Drupal site with content already available in one language (source language). This guide will cover:

1. Globalization step: getting your Drupal site ready to be localized

  • Installing the TMGMT plugin for localization

    1. Marking which content you want to localize

    2. Selecting languages to localize your content to

2. Linking your Drupal site with Transifex

  • Adding the Transifex plugin in Drupal and configuring it

3. Localizing Drupal content using Transifex

  • Selecting content for localization (we support every content type that Drupal passes to the translation module. Depending on the content type, if this is not supported natively, you may need to use a plugin for i18n support)

    1. Monitoring localization progress

    2. Getting localized content back and making it available on your Drupal site

4. Setting up an auto-update webhook with Transifex

Globalization step

First, get your Drupal website ready for localization. Since version 8, Drupal natively supports localization by including a TMGMT module in its core distribution. This module enables localization options for a Drupal website.

Marking which contents to localize

  1. Visit the Drupal admin interface and go to Configuration > Content language and translation (grouped under 'REGIONAL AND LANGUAGE' widget)


  2. You'll see a list of all localizable content. Check the content that you would like to localize (more details: https://www.drupal.org/docs/8/multilingual/translating-content)


Selecting the target languages

  1. Head to Configuration > Regional and language and choose Languages to add languages you want to localize to (i.e., target languages)


    This is where you can add the languages.


  2. Click + Add language to add a language from the list.


    Or choose Custom language to add a custom language.


  3. In the list of languages, if you click Edit, you'll see its language code and name and define it as a 'Left to Right' or 'Right to Left' language.


Linking your Drupal site with Transifex

  1. Install the module on your Drupal site:

Setting up localization with the Transifex plugin

  1. Go to the Translations tab.


  2. Go to Providers.


  3. Click Edit on the Line labeled Transifex to set up the provider.

  4. In this form, you can edit the provider settings.


    Label & Description fields are a help text, so add something basic and descriptive.

    Provider plugin is where you pick any available translation services. If another localization plugin is available, it will be listed here. Choose Transifex.

  5. Provide the necessary information to link the Drupal website with your Transifex project.


  6. Next, move to the language mapping.


    Each label locale represents the locale that Drupal uses for the language; each dropdown selection represents the locale Transifex is using.

    Once you're done setting the Remote language mappings, hit Save to update the provider setting.

Sending content to Transifex

Now that the configuration process is done, you can send content from Drupal to Transifex for translation.

In Drupal terminology, these localization requests are called Jobs.

  1. In the Drupal admin interface, go to Translations. The Jobs tab contains all the translation requests sent to translation providers.


  2. Click on the Sources tab. This is where you can see a list of all your translatable Drupal content.


  3. Choose the content you are interested in, and choose the Source Language and Target Language from the dropdown (you can select more than one target language).


  4. After this, click the Request translation button to send the translation content in Transifex.

    You will see a progress bar, Submitting Jobs, and a few notifications will appear.


  5. This way, the content was pushed to Transifex as resources. Opening Transifex, you will see the created resource files with the same name as the Drupal content.

Previewing translation jobs progress in Drupal

Transifex and Drupal do not communicate in real time about translation services. So, to check the status of your translation Jobs, you need to query the Transifex service.

  1. In the Drupal admin interface, go to Translations. Go to Jobs to see the list of all the translation jobs.

  2. Select the translation job you're interested in and click on Manage to see its details.


  3. Click on Check for updates in the Provider information widget.


    This action will query Transifex and update Drupal with the translation progress information.

Getting translations from Transifex to Drupal

After the steps from the above section are complete, additional steps are needed to display the localized content on your Drupal site fully.

Incoming localization jobs from Transifex are considered as "need review".

  1. Go to the specific translation Job. The content pushed from Transifex is in yellow and marked as needing Review (in the Operations column).


  2. Click Review to validate the incoming localization jobs from Transifex. You'll see a list of all the content in the source and target languages.


  3. Click Save as completed - this will review and complete the specific translation job, returning to the translation job overview page.


⚠️Warning: Having set up your language selectors for your Drupal site, these actions will make the localized version immediately available on your website!

💡Tip: You can skip the manual review of the incoming changes from the Transifex provider interface. To do so:

  1. Visit the Drupal admin page and go to Translations > Providers.

  2. Choose Transifex and click Edit.

  3. Enable Auto to accept finished translations.

Setting up an auto-update webhook with Transifex

This will enable auto-fetching translations from Transifex once the content sent to Transifex is 100% translated.

  1. Go to your Transifex Project settings > Webhooks and create a new webhook.

  2. In the URL field, add the Drupal domain of your site followed by '/tmgmt_transifex_callback'. Ex. if your Drupal domain is www.mydrupalsite.com, you should add ‘http://www.mydrupalsite.com/tmgmt_transifex_callback’


    Add a custom Secret Key; in the Event field, select All events. Make sure that the Webhook Status is Active and click Save Changes.

  3. Navigate to the Drupal admin page, select Translation > Providers, select Transifex, and click Edit.

    Go to Transifex plugin settings > Transifex webhook secret and add the Secret Key you've added in Transifex.


    If you want to get the translated content from Transifex when reviewed, check the related checkbox Pull only when a language is 100% reviewed.


Looking for more help? Get support from our Transifex Community Forum!

Find answers or post to get help from Transifex Support and our Community.

Did this answer your question?