Build a batch to get the status of remote and local translation files.
The batch process fetches the state of both remote and (if configured) local translation files. The data of the most recent translation is stored per per project and per language. This data is stored in a state variable 'locale_translation_status'. The timestamp it was last updated is stored in the state variable 'locale_translation_status_last_update'.
array $sources: Array of translation source objects for which to check the state of translation source files.
function locale_translation_batch_status_build($sources) {
$operations = array();
// Set the batch processes for remote sources.
foreach ($sources as $source) {
$operations[] = array(
'locale_translation_batch_status_fetch_remote',
array(
$source,
),
);
}
// Check for local sources, compare the results of local and remote and store
// the most recent.
$operations[] = array(
'locale_translation_batch_status_fetch_local',
array(
$sources,
),
);
$operations[] = array(
'locale_translation_batch_status_compare',
array(),
);
$batch = array(
'operations' => $operations,
'title' => t('Checking available translations'),
'finished' => 'locale_translation_batch_status_finished',
'error_message' => t('Error checking available interface translation updates.'),
'file' => drupal_get_path('module', 'locale') . '/locale.batch.inc',
);
return $batch;
}