Builds 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_last_checked'.
array $projects: Array of project names for which to check the state of translation files. Defaults to all translatable projects.
array $langcodes: Array of language codes. Defaults to all translatable languages.
array Batch definition array.
function locale_translation_batch_status_build($projects = array(), $langcodes = array()) {
$t = get_t();
$projects = $projects ? $projects : array_keys(locale_translation_get_projects());
$langcodes = $langcodes ? $langcodes : array_keys(locale_translatable_language_list());
$operations = _locale_translation_batch_status_operations($projects, $langcodes);
$batch = array(
'operations' => $operations,
'title' => $t('Checking translations'),
'progress_message' => '',
'finished' => 'locale_translation_batch_status_finished',
'error_message' => $t('Error checking translation updates.'),
'file' => drupal_get_path('module', 'locale') . '/locale.batch.inc',
);
return $batch;
}