Connect Drupal with Smartcat

Overview

The Smartcat integration with Drupal lets you send content from Drupal to Smartcat for translation, manage the translations in your Smartcat account, and then send them back to Drupal — all through the TMGMT connector.

Integration type: Module — content is managed within Drupal's native interface (via TMGMT), not inside Smartcat's integration view.

Supported Drupal versions: 8, 9, and 10


Prerequisites

Before setting up this integration, ensure you have:

  • A Smartcat workspace with an active account and API access

  • A Drupal website with Admin panel access

  • The following modules installed:

  • TMGMT (Translation Management Tool)

  • Smartcat plugin for TMGMT

  • Cron manager module (Ultimate Cron — required for Continuous Translation)


Installation and setup

Install the TMGMT module

  1. Download the ZIP archive or copy the tar.gz download link from the official website.

  2. Enable the Update Manager Module in the Admin panel of your Drupal website by ticking the relevant box.

  3. Select Add a new module and paste the link into the archive (or upload the archive) into the window that opens.

  4. Choose Enable recently added modules from the Next Steps list and select the modules used by TMGMT in the Translation Management section. Click Proceed.

    image

  5. Select the languages you want to work with in the Language and Region settings of your website.

If successful, you see a new Translation tab in the Drupal interface.

image

Install the Smartcat module

  1. Download the ZIP archive or copy the tar.gz download link from the official website.

  2. Add it to your website as a new module as described above.

  3. Enable the Smartcat Translator by ticking the relevant box in the Translation Management section.

image

Install the Cron manager module

  1. Download the ZIP archive or copy the tar.gz download link from the official website.

  2. Add it to your website as a new module as described above.

  3. Enable the Ultimate Cron by ticking the relevant box in the Other section.

image

Connect Smartcat

In your Smartcat account:

  1. In the left navigation sidebar, click Settings → API to generate API key.

    image

  2. Click Create New Key to open the dialog.

    image

  3. Copy the API key as well as your account ID.

On your Drupal website:

  1. Navigate to the Providers tab in the Translations section of your Drupal website and select Smartcat.

  2. Paste your API key and the account ID into the corresponding sections, and select your preferred server.

  3. Click Save.

image


Translating content

There are two ways to set up the translation workflow:

  • On Demand Translation — manually send required articles for translation.

  • Continuous Translation — automatically send each newly created or updated article (of the specified type/s) as a new job item to the preconfigured translator.

On Demand Translation

  1. Navigate to Structure → Content Types and select Operations → Edit for each content type you want to translate.

  2. Navigate to the Language settings tab and select Enable translation and Show language selector for these content types.

  3. The selected sources will be available in the Sources section of your Providers tab.

  4. Tick the ones you want to translate right away, select the source and target languages, and click Request translation.

  5. Select Smartcat as your translation provider and submit the job.

📌 A job is created for each target language. To translate one text into several languages at once, tick the relevant box.

  1. Smartcat creates a project for each job you submit. These are also available in the Jobs section of your Drupal website. You can monitor the progress of translations in the Translation Job Messages.

  2. To complete the job, approve all the selected segments in Smartcat.

  3. To push the translations back, enter the relevant job on your Drupal website and click Download translations.

  4. Enter the job, approve the translations, and click Publish. The target language version of your article will be generated and published.

Translating custom fields

  1. Navigate to the Content types section of your website's Structure, and add a new field for the material you want to edit.

  2. Select the type of field, e.g. plain text, list, or image.

  3. Fill in the rest of the data (e.g. alt-text, category, or tags) and click Save.

  4. Return to the Configuration section and tick the fields you want to translate (e.g. title, tags, etc.) and click Save. If you tick no fields, only the title will be translated.

📌 Make sure the fields you select can be translated. The only field that cannot be translated for now is the Category field, as it is uploaded from Drupal as a numeric value.

  1. Submit the material for translation as described above. Review the translations in the Editor and push them back to Drupal.

Continuous Translation setup

  1. Go to the main translation page by clicking Translation from the toolbar.

  2. Confirm there is a configured continuous translator on the Providers page (the Smartcat provider).

  3. Open the Jobs menu tab and click Add continuous job.

  4. Configure options including translator selection, label, source and target language, and content types available for translation.

    image

    image

  5. Click Save job to complete the process.

Each newly created article of the selected type/s is automatically created as a new job item and sent to the preconfigured translator.

The continuous translation process is provided via a scheduler thanks to Cron. TMGMT and Smartcat provide special scheduler tasks that automatically send and receive translations from Smartcat.

To configure Cron for continuous translation:

  1. Make sure the Ultimate Cron module is installed. It extends Drupal's native cron features and expands control over repeating jobs.

  2. Go to the TMGMT settings page: Translation → Settings.

  3. Enable Submit continuous job items on cron under the Performance settings block. We recommend specifying the value 5 in the Number of job items to process on cron field.

    image

  4. Marke sure Ultimate Cron is enabled. Extend → Install new module enables site administratores to install new modules.

  5. Go to Configuration → Cron → Cron Jobs. Look for the Default cron handler provided by Translation Management Core and Smartcat translator, and click Edit.

  6. Translation Management Core: Responsible for submitting and updating translations in the Smartcat project.

  7. Smartcat translator: Responsible for receiving translations from Smartcat and importing them into Drupal.

  8. Use the Run cron every option to set an interval for the cron job to run.

    image

  9. Make sure the cron job is enabled and click Save.

Automatic run of cron tasks

To ensure tasks run automatically every minute or every 15 minutes, you need the Cron trigger to always be running.

  1. Go to Configuration → System → Cron → Run cron to find your Cron link.

    image

  2. Set up this link to be called automatically every minute by configuring your server. On Linux, run the following command:
crontab -e
*/1*      * wget -O - -q -t 1 https://your_drupal_cron_link > /dev/null

Retrieving translations

When Smartcat finishes translating, return to Drupal and follow these steps:

  1. Enter the relevant job in the Jobs section of your Drupal website.

  2. Click Download translations to pull the completed translations back into Drupal.

  3. Approve the translations and click Publish.

Monitoring progress: In the Translation → Jobs items tab, articles sent to Smartcat will have the status In progress. Job items with the status Inactive are waiting to be sent to Smartcat.

Sending is done in batches (5 items at a time by default) to avoid timeout problems. You can run cron jobs manually for testing without waiting for the scheduled interval.


How to check if everything works

Let's imagine that you have 10 articles that are in your continuous job.

When you run a cron task from Translation Management Core, the first 5 articles will be sent to Smartcat. There is currently no option to select an existing project in Smartcat. Therefore, if this is the first content submission, the project will be automatically created and linked to the continuous job. In the future, all content will go into this project.

In the Translation → Jobs items tab you can find articles sent to Smartcat; they will have the status In progress. Job items with the status Inactive are those that are waiting to be sent to Smartcat.

image

Don't forget to filter items by the states parameter.

If you run the cron job from Translation Management Core again, the following 5 articles (which are in Inactive status) will be sent to Smartcat.

Sending in batches is necessary in order to avoid "timeout" problems during task execution.

This way you can run the cron job until all documents are sent to Smartcat. As a reminder, this will happen automatically if Cron is configured.

Now let's translate one of the articles in Smartcat and try to get the translation back into Drupal.

image

To get translations back into Drupal, you need to run a cron task from Smartcat translator.

image

This task automatically receives all job items that are in the In progress status and tries to get translations from Smartcat.

Articles that have been translated and successfully imported into Drupal will receive an Accepted status.

image

Still need help?

Our support team responds within one business day.

Open a support case