function _locale_translation_fetch_operations

_locale_translation_fetch_operations($projects, $langcodes, $options)

Helper function to construct the batch operations to fetch 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.

Return value

array Array of batch operations.

File

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

Code

function _locale_translation_fetch_operations($projects, $langcodes, $options) {
  $operations = array();

  foreach ($projects as $project) {
    foreach ($langcodes as $langcode) {
      if (locale_translation_use_remote_source()) {
        $operations[] = array('locale_translation_batch_fetch_download', array($project, $langcode));
      }
      $operations[] = array('locale_translation_batch_fetch_import', array($project, $langcode, $options));
    }
  }

  return $operations;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!modules!locale!locale.fetch.inc/function/_locale_translation_fetch_operations/8.1.x