Allows to alter job checkout workflow before the default behavior.
\Drupal\tmgmt\JobInterface $job: The Job being submitted.
function hook_tmgmt_job_before_request_translation(JobInterface $job) {
/** @var \Drupal\tmgmt\Data $data_service */
$data_service = \Drupal::service('tmgmt.data');
// Do changes to the data for example.
foreach ($job
->getItems() as $job_item) {
$unfiltered_data = $job_item
->getData();
$data_items = $data_service
->filterTranslatable($unfiltered_data);
foreach ($data_items as $data_item) {
$data_item['property'] = 'new value';
}
}
}