Helper function to construct batch operations checking remote translation status.
array projects: Array of project names to be processed.
array langcodes: Array of language codes.
array Array of batch operations.
function _locale_translation_batch_status_operations($projects, $langcodes) {
$operations = array();
// Set the batch processes for remote sources.
$sources = locale_translation_build_sources($projects, $langcodes);
if (locale_translation_use_remote_source()) {
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(),
);
return $operations;
}