You are here

function _l10n_update_create_batch in Localization update 7

Same name and namespace in other branches
  1. 6 l10n_update.batch.inc \_l10n_update_create_batch()

Create batch stub for this module.

Parameters

$operations: Operations to perform in this batch.

Return value

array A batch definition:

  • 'operations': Batch operations
  • 'title': Batch title.
  • 'init_message': Initial batch UI message.
  • 'error_message': Batch error message.
  • 'file': File containing callback function.
  • 'finished': Batch completed callback function.
3 calls to _l10n_update_create_batch()
l10n_update_batch_download in ./l10n_update.batch.inc
Create a batch to just download files.
l10n_update_batch_import in ./l10n_update.batch.inc
Create a batch to just import files.
l10n_update_batch_multiple in ./l10n_update.batch.inc
Create a big batch for multiple projects and languages.

File

./l10n_update.batch.inc, line 90
Reusable API for creating and running l10n update batches.

Code

function _l10n_update_create_batch($operations = array()) {
  $t = get_t();
  $batch = array(
    'operations' => $operations,
    'title' => $t('Updating translation.'),
    'init_message' => $t('Downloading and importing files.'),
    'error_message' => $t('Error importing interface translations'),
    'file' => drupal_get_path('module', 'l10n_update') . '/l10n_update.batch.inc',
    'finished' => '_l10n_update_batch_finished',
  );
  return $batch;
}