function locale_translation_batch_status_build

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'.

Parameters

array $sources: Array of translation source objects for which to check the state of translation source files.

1 call to locale_translation_batch_status_build()
locale_translation_check_projects_batch in drupal/core/modules/locale/locale.compare.inc
Gets and stores the status and timestamp of remote po files.

File

drupal/core/modules/locale/locale.batch.inc, line 21
Batch process to check the availability of remote or local po files.

Code

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;
}