function LocaleProjectRepository::getProjectList

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

Fetch an array of projects for translation update.

Return value

array Array of project data including .info.yml file data.

File

core/modules/locale/src/LocaleProjectRepository.php, line 192

Class

LocaleProjectRepository
Provides storage and rebuilding of locale project information.

Namespace

Drupal\locale

Code

protected function getProjectList() : array {
  $projects = [];
  $additional_allow_list = [
    'interface translation project',
    'interface translation server pattern',
  ];
  $module_data = $this->prepareProjectList($this->moduleExtensionList
    ->getList());
  $theme_data = $this->prepareProjectList($this->themeExtensionList
    ->getList());
  $project_info = new ProjectInfo();
  $project_info->processInfoList($projects, $module_data, 'module', TRUE, $additional_allow_list);
  $project_info->processInfoList($projects, $theme_data, 'theme', TRUE, $additional_allow_list);
  // Allow other modules to alter projects before fetching and comparing.
  $this->moduleHandler
    ->alter('locale_translation_projects', $projects);
  return $projects;
}

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