function locale_translation_batch_fetch_build

Builds a batch to download and import project translations.

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.

array $options: Array of import options. See locale_translate_batch_import_files().

Return value

array Batch definition array.

2 calls to locale_translation_batch_fetch_build()
install_import_translations in drupal/core/includes/install.core.inc
Imports languages via a batch process during installation.
locale_translation_status_form_submit in drupal/core/modules/locale/locale.pages.inc
Form submission handler for locale_translation_status_form().

File

drupal/core/modules/locale/locale.fetch.inc, line 63
The API for download and import of translations from remote and local sources.

Code

function locale_translation_batch_fetch_build($projects = array(), $langcodes = array(), $options = array()) {
  $projects = $projects ? $projects : array_keys(locale_translation_get_projects());
  $langcodes = $langcodes ? $langcodes : array_keys(locale_translatable_language_list());
  $t = get_t();
  $batch = array(
    'operations' => _locale_translation_fetch_operations($projects, $langcodes, $options),
    'title' => $t('Updating translations.'),
    'progress_message' => '',
    'error_message' => $t('Error importing translation files'),
    'finished' => 'locale_translation_batch_fetch_finished',
    'file' => drupal_get_path('module', 'locale') . '/locale.batch.inc',
  );
  return $batch;
}