Gets and stores the status and timestamp of remote po files.
A batch process is used to check for po files at remote locations and (when configured) to check for po files in the local file system. The most recent translation source states are stored in the state variable 'locale_translation_status'.
@params array $projects Array of translatable projects. @params array $langcodes Array of language codes to check for. Leave empty to check all languages.
function locale_translation_check_projects_batch($projects, $langcodes = NULL) {
$langcodes = $langcodes ? $langcodes : array_keys(locale_translatable_language_list());
$sources = array();
foreach ($projects as $name => $project) {
foreach ($langcodes as $langcode) {
$source = locale_translation_source_build($project, $langcode);
$sources[] = $source;
}
}
// Build and set the batch process.
module_load_include('batch.inc', 'locale');
$batch = locale_translation_batch_status_build($sources);
batch_set($batch);
}