function LocaleProjectChecker::checkProjects

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

Check for the latest release of project translations.

Parameters

array $projects: Array of project names to check.

array $langcodes: Array of language codes. Defaults to all translatable languages.

File

core/modules/locale/src/LocaleProjectChecker.php, line 44

Class

LocaleProjectChecker
Provide Locale Project Checker helper methods.

Namespace

Drupal\locale

Code

public function checkProjects(array $projects, array $langcodes = []) : void {
  if (locale_translation_use_remote_source()) {
    // Retrieve the status of both remote and local translation sources by
    // using a batch process.
    $this->triggerBatch($projects, $langcodes);
  }
  else {
    // Retrieve and save the status of local translations only.
    $this->checkLocalProjects($projects, $langcodes);
    $this->state
      ->set('locale.translation_last_checked', $this->time
      ->getRequestTime());
  }
}

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