function LocaleFetch::getStatusOperations

Same name and namespace in other branches
  1. 11.x core/modules/locale/src/LocaleFetch.php \Drupal\locale\LocaleFetch::getStatusOperations()

Constructs batch operations for checking remote translation status.

Parameters

array $projects: Array of project names to be processed.

array $langcodes: Array of language codes.

array $options: Batch processing options.

Return value

array Array of batch operations.

File

core/modules/locale/src/LocaleFetch.php, line 139

Class

LocaleFetch
Provides the locale fetch services.

Namespace

Drupal\locale

Code

public function getStatusOperations(array $projects, array $langcodes, array $options = []) : array {
  $operations = [];
  foreach ($projects as $project) {
    foreach ($langcodes as $langcode) {
      // Check version and status translation sources.
      $operations[] = [
        self::class . ':batchVersionCheck',
        [
          $project,
          $langcode,
        ],
      ];
      $operations[] = [
        self::class . ':batchStatusCheck',
        [
          $project,
          $langcode,
          $options,
        ],
      ];
    }
  }
  return $operations;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.