Connect Drupal with Smartcat

Discover how to connect Drupal with Smartcat for seamless content translation and management using the TMGMT connector.

With Smartcat and the TMGMT connector, you can send content from Drupal to Smartcat for translation, manage the translations in your Smartcat account, and then send them back to Drupal.

What you need

  • TMGMT module

  • Smartcat plugin

  • Cron manager module

To 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/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 .

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

In case of success, you will see new “Translation” tab in the Drupal interface.

To 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.

To install 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.

Setting up the integration

In your Smartcat account:

1. Navigate to Settings- >API on the left-hand side menu to generate an API key.

2. Click Create New Key to open the following dialog:

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.

In case of success you might see confirmation message:

The translation process

There are 2 ways to set up the translation workflow:

  1. On Demand Translation – to manually send required articles for translations.

  2. 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 setup

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*.

*Please note that a job is created for each target language. To translate one text into several languages at once, tick the relevant box.

6. Smartcat will create 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.

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

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

9. 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.

*Please make sure the fields you select can be translated.

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

*The only field that can’t be translated for now is the Category field as it’s uploaded from Drupal as a numeric value.

Continuous Translation setup

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

  1. Make sure there is a configured continuous translator on the "Providers" page. In this case, it is the Smartcat provider.

  1. Open "Jobs" menu tab and click on "Add continuous job"

  1. The page provides several configuration options including translator selection, label, source and target language. By default, the continuous settings block displays a list of content types available for translation.

  1. Click "Save job" to complete the process.

Each newly created article (of the selected type/s for continuous translation) will be 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 will automatically send and receive translation from Smartcat. These tasks will be automatically launched thanks to Cron, which will automate the localization process.

Continuous Translation setup

First, you need to make sure that the Ultimate Cron module is installed.

Ultimate Cron extends Drupal’s native cron features and expands control over repeating jobs.

The following manual will explain how to enable translation jobs to run repeatedly.

  1. Go to the TMGMT settings page, “Translation” > “Settings”.

  1. Enable “Submit continuous job items on cron” option placed under “Performance settings” block. We recommend specifying the value 5 in the "Number of job items to process on cron" field. This is the number of jobs that will be processed in one iteration of continuous translation. In other words, this is the number of documents that will be uploaded to Smartcat at one time.

  1. Make sure Ultimate Cron is enabled. “Extend” > “Install new module” enables site administrators to install new modules.

  1. Go to “Configuration” > “Cron” > “Cron Jobs”. It provides an overview of available cron runs.

  1. Look for “Default cron handler” provided by “Translation Management Core” and “Smartcat translator” and click the “Edit” button.

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

b. Smartcat translator: Responsible for receiving translations from Smartcat, as well as importing into Drupal.

  1. The Cron edit page provides several settings related to the TMGMT cron job. Using the “Run cron every” option, it is possible to set an interval for the cron job to run on.

  1. Make sure the cron job is enabled and finish the process with “Save”.

If you have added a continuous job and configured Cron, the continuous localization process will start working. The Cron tasks that were described above will run automatically depending on the interval that you specified.

For testing purposes, you don't have to wait for Cron to run the necessary tasks, so you can use the "Run" button that each task has separately.

Automatic run of cron tasks

In order for tasks to automatically run every minute or every 15 minutes (depending on the settings), you need to ensure that the Cron trigger is always running.

Go to Configuration → System → Cron → Run cron. Here you will find a special link that you can follow to run Cron. We recommend setting up this link to be called automatically every minute so that tasks run consistently.

To do this, you need to go to your server settings. If you are using Linux, then run the command:

crontab -e

*/1  * * * * wget -O - -q -t 1 https://your_drupal_cron_link > /dev/null

Save your changes. Now the cron scheduler will automatically send a request every minute to the link you specify, which will ensure stable running of tasks.

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 Smarcat.

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 into Smartcat and try to get the translation back into Drupal.

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

This task will automatically receive all job items that are in the "In progress" status and try to get translations from Smartcat.

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

Did this article help you find the answer you were looking for? If not or if you have further questions, please contact our support team.

FAQ

Which versions of Drupal support integration with Smartcat?

Smartcat integrates with Drupal through the TMGMT module, which supports Drupal versions 8, 9, and 10.

What permissions and access rights are needed for the proper functioning of the integration?

Users managing translation workflows in Drupal need the appropriate permissions within the TMGMT module, including access to translation sources, job creation, and Smartcat as a provider. Admin access may be required for configuration.

Are there any limitations on the types of content that can be sent for translation?

The integration can translate any content type supported by the TMGMT module in Drupal.

Is the workflow status visible to the client in Drupal (if the client doesn’t have access to Smartcat)?

Yes, the translation status is visible within the TMGMT module in Drupal.

How are content updates handled? Are only the modified parts of the text sent for translation?

This depends on how TMGMT processes content changes. By default, TMGMT treats updates as new translation jobs, unless specific settings enable the use of translation memory for partial updates.

How is the returned translated content managed: manual or automatic publication?

Both options are available. Users can configure whether translations should be published automatically or manually reviewed before publication.

Is a preview of the translated content available before publication?

Yes, translated content can be reviewed in Drupal before publication.

What metadata is sent along with the content (e.g., page title, SEO tags)?

The transfer of metadata depends on the configuration of the TMGMT module. Common elements such as page titles and SEO tags can be included if mapped correctly.

What server or hosting configurations are required to ensure the integration works correctly?

A standard Drupal environment is sufficient. The integration relies on the TMGMT module and should work with any typical Drupal hosting setup.

Are there recommendations for testing the integration?

Testing should follow Smartcat’s integration documentation, including content translation workflows, content synchronization, and publication verification. For detailed guidance, refer to the Smartcat Help Center's article on Drupal integration.

What debugging tools or logs are available for monitoring the integration’s performance?

Standard Drupal logs are available for debugging issues related to the integration. Additional troubleshooting steps can be found in the Smartcat Help Center.

What should be done if the translation is not synchronized back from Smartcat?

Check the logs for any errors and ensure that the Smartcat API connection is active. If issues persist, refer to the Smartcat Help Center or contact Smartcat support.

How does the integration handle large volumes of content? Are there any limitations?

The integration is designed to handle large volumes of content, but performance may vary depending on server resources and Drupal’s TMGMT processing capabilities.

How are HTML/formatting tags handled? Is there an option to exclude or customize their parsing?

Smartcat handles formatting automatically, but users can manage it via TMGMT settings.

Are images transferred during the translation process? If yes, how is the processing handled: are file paths modified, or is manual configuration required?

Image transfer is possible, but this functionality is not yet supported.

Does the integration support right-to-left (RTL) languages?

Yes, Smartcat supports RTL languages. However, proper display depends on Drupal’s theme and language settings.