Drupal

Join the beta

Our Drupal integration is currently in beta. If you're interested in getting access, please contact us.

Transifex’s Drupal integration lets you translate your Drupal site using Transifex. It works as an add on to Translation Management Tool (TMGMT), a popular module for Drupal localization. For now, only Drupal 7 is supported.

This guide will walk you through the process of setting up TMGMT, configuring the Transifex connector, sending content from Drupal to Transifex, and getting translations back in an automated way.

Next, you can add the languages that you want to translate your site to:

From the top navigation, head to Configuration. Then under REGIONAL AND LANGUAGE, click on Languages.

Click on +Add language.

Select a language from the list and then click Add language. Note that by default Drupal uses the generic version of a language, e.g. fr and not fr_FR. If a language you want isn’t in the list, you can add it through the Custom Language section.

Repeat Steps 2 and 3 to add all the languages you wish to translate your Drupal site to.

After installing TMGMT, you need to select which content types will be translatable. To do this:

From the top navigation, click on Structure. Then click on Content Types.

Select the content type you want to translate and click on the Edit link next to it.

Click on the Publishing options tab on the left, then select Enabled, with field translation under Multilingual support.

Note that existing content won’t inherit this configuration. It is only applied to new content. If everything worked, you should be able to see the translatable content under Translation > Sources > Content.

You can further configure the translation of the content type by going to Configuration > Regional > Entity translation. Here, we recommend you set the Default language to your source language, and not Language neutral. On this page, you can also configure options such as Language fallback.

From the top navigation, head to Configuration, then select Translation Management Translators.

Click on Edit next to the Transifex Connector.

Under TRANSIFEX TRANSLATOR PLUGIN SETTINGS, enter your Transifex API token. If you don’t already have a token, you can generate one from the User Settings page.

Enter the URL for the Transifex project you created earlier, which should look something like https://www.transifex.com/organization_slug/project_slug/. Be sure to include the https:// at the beginning and that there's no /dashboard/ at the end.

If you want translations to be automatically pulled back into Drupal using webhooks, enter a webhook secret. The secret can contain any type of character and be up to 128 characters long. Then in a separate tab, head to your project in Transifex and under Settings > Webhooks, add a new webhook. In the popup, set the URL to <https://yourdrupalsite.com>/tmgmt_transifex/webhook/ and the event type to All Event. Then set the status to Active.

Back in Drupal, you can decide if translations should be pulled when it's 100% translated or 100% reviewed. By default, translations can only be pulled when it's 100% translated in a language.

Finally, you can control if the translations received by Transifex should be automatically inserted into Drupal. If so, enable Auto accept finished translations under the TRANSLATOR SETTINGS section. If your translation reviews are happening in Transifex, we recommend enabling auto accept.

Now that the configuration process is done, you're ready to send content from Drupal to Transifex for translation:

Click on the Translation menu item at the top of your admin bar. Then select the Sources tab.

Using the checkboxes, select the content you want to translate. Then hit Request translation.

On the next page, you can give the translation job a name (label) and select the target language for the job. Be sure Transifex translator is the selected translator.

Click Submit to translator to send the content to Transifex. For each node in Drupal, there will be a corresponding resource in Transifex. You can see the new job under the Jobs tab of the Translation page.

If you have webhooks enabled, then translations will be pulled automatically either when a language is 100% translated or reviewed. When this happens, the translations retrieved will be automatically applied on the site.

Now that you have your translations back in Drupal, you need to offer your visitors a way to pick which language they want to view content in. To do this:

Head to Configuration in the top navigation. Then under REGIONAL AND LANGUAGE, click on Languages.

Select the DETECTION AND SELECTION tab.

Under the User interface text language detection section, you can choose how the language of the user interface is determined and prioritize the detection methods. It's worth noting that the user interface is made of miscellaneous text strings used through the site, e.g. the label on a submit button, and it's different from your content. No matter what you choose, we recommend enabling the URL option.

Then in the Content language detection section, choose how the content language should be detected. If the language of the content should match the language of the user interface, then enable the Interface detection method and drag it to the top of the list.

Hit Save settings at the bottom of the page to finalize the changes.

Next, from the top navigation, head to Structure and then select Blocks.

Next to Language switcher (User interface text), select where you want the language switcher to appear.

In Drupal, you can translate the interface as well as the content. While content such as the words on an "About us" page might vary from site to site, the interface, made of labels such as "Submitted by," is standardized across all Drupal sites. Because of this, you can take advantage of the translations already done by the Drupal community. You just need to import them to your site. Here's how you can do this: