function locale_translation_batch_status_build

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

Parameters

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.

Return value

array Batch definition array.

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.compare.inc, line 299
The API for comparing project translation status with available translation.

Code

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