Drupal: Continuous job

Introduction

XTM Connect - Drupal has some automated functions for continuous submission of new source content for translation in XTM Cloud. This involves the continuous job functionality: it automatically detects new and updated content of a specific type. This content is sent for translation in individual projects, in time periods that are set in Cron. Continuous jobs only support a single source to target language combination.


Setting up a continuous job

To set up a continuous job on the Drupal instance, proceed as follows:

  1. In Drupal, go to the Jobs section (Manage → Translation → Jobs), and select the +Add continuous job option.

  1. This is the section where the continuous job is configured:

  • Label → enter a name for your continuous job.

  • Source language & Target language → as mentioned in the Introduction, a continuous job only supports a single source to target language combination. Choose the source and target language for which content is be sent to XTM Cloud. In this case (see the screenshot below), the source language is English which means that all new content whose source language is English will automatically be sent for translation into German.

  • Owner → this field is not relevant and can be left empty.

  • CONTINUOUS SETTINGS → in this section, choose what type of content a continuous job will be taking for XTM translation. When you select a basic type (Content, Custom block or Custom menu link), the display expands into another list containing its specific sub-types.

  • Provider → select one of the translation providers configured in Manage → TranslationProviders. This provider will receive translation projects that are created by the continuous job. When you select a particular XTM Cloud provider, relevant XTM Cloud project templates are imported from the provider’s XTM Cloud instance. The appropriate project templates can be chosen in the next option.

  • XTM project template → select an XTM Cloud project template. The templates that are available are the ones that, on the XTM Cloud side, are either set to Global or to the customer that is used in the XTM Connect - Drupal integration, and for which projects are created in XTM Cloud.

  • Project mode → select the mode in which an XTM Cloud project will be created.

Once all the parameters have been set, click the Save job button to create your continuous job.

  1. A newly-created continuous job is listed in the Jobs section.


How does a continuous job actually work?

General information

Once a continuous job is created, it starts its work. From now on, all new or updated content that is found in Drupal will be picked up and sent to XTM Cloud by that continuous job, in the form of translation projects.

IMPORTANT!

In contrast to the standard XTM Cloud approach, in which one continuous project exists, and is regularly updated with new source content, each run of the continuous job in Drupal creates separate translation projects in XTM Cloud.

Every new XTM Cloud project that is created within the framework of a particular continuous job contains previously sent content, enabling the end user to retain all the source text translated so far (and therefore all the contextual information) in a single XTM Cloud job. In other words, each subsequent XTM Cloud project will be larger than the preceding one.

IMPORTANT!

In case of updated content that is found in a given item, in Drupal, the TMGMT plugin does not automatically detect changes. A continuous job will only create a new project if old translations are marked as outdated. Translations can be marked as “outdated” by selecting the Flag other translations as outdated checkbox in the Content Editor view and saving. This will change the status of existing translations and then trigger the continuous job.

Nevertheless, there is more to the concept of the continuous job in Drupal, and there are a couple of rules that you need to know.

Cron

To start a continuous job automatically, the Cron job needs to be enabled. Go to Manage → Configuration → SYSTEMCron. In the CRON SETTINGS section, set the Cron job to the specific time interval at which the continuous job is run. Do not forget to save your configuration.

If the Cron job is set to Never, the continuous job will never be run, even if new source content arrives at Drupal. If this is the case, use the Run cron option to force immediate execution of the continuous job. Under this option, you will also find information about when it was last run.

Check for continuous job

An important thing to bear in mind is that, once a particular continuous job has been set up, it will not take “existing” content (content that was created in Drupal before the continuous job was created) into account and send it for translation in XTM cloud. If you need to do this, use the Check for continuous job option. It is located in the Sources section (Manage → Translation → Sources → OPERATIONS).

To use this feature, first select relevant sources that meet the requirements of a particular continuous job from the list. Then click the Check for continuous job button. At this point, selected content IS NOT YET sent off to XTM Cloud for translation but merely added to the continuous job “queue”. It will be sent for translation next time the Cron job runs.

In the continuous job “queue”, the language jobs for the content have the status Inactive. They are waiting for the Cron job to run and send them to XTM Cloud as a translation project.

If all “existing” content that is eligible for translation in XTM Cloud is to be added to the “queue”, first select the All (continuous check only) checkbox and then click the Check for continuous job button.