Batch operation callback: Check the availability of local po files.
Checks the presence and creation time of po files in the local file system. The file path and the timestamp are stored.
array $sources: Array of translation source objects of projects for which to check the state of local po files.
array $context: The batch context array. The collected state is stored in the 'results' parameter of the context.
locale_translation_batch_status_fetch_remote()
locale_translation_batch_status_compare()
function locale_translation_batch_status_fetch_local($sources, &$context) {
$t = get_t();
// Get the status of local translation files and store the result data in the
// batch results for later processing.
foreach ($sources as $source) {
if (isset($source->files[LOCALE_TRANSLATION_LOCAL])) {
locale_translation_source_check_file($source);
// If remote data was collected before, we merge it into the newly
// collected result.
if (isset($context['results']['sources'][$source->name][$source->langcode])) {
$source->files[LOCALE_TRANSLATION_REMOTE] = $context['results']['sources'][$source->name][$source->langcode]->files[LOCALE_TRANSLATION_REMOTE];
}
// Record success and store the updated source data.
$context['results']['files'][$source->name] = $source->name;
$context['results']['sources'][$source->name][$source->langcode] = $source;
}
}
$context['message'] = $t('Checked all translations.');
}