function locale_translation_build_projects

Same name and namespace in other branches
  1. 10 core/modules/locale/locale.compare.inc \locale_translation_build_projects()
  2. 11.x core/modules/locale/locale.compare.inc \locale_translation_build_projects()
  3. 9 core/modules/locale/locale.compare.inc \locale_translation_build_projects()
  4. 8.9.x core/modules/locale/locale.compare.inc \locale_translation_build_projects()

Builds list of projects and stores the result in the database.

The project data is based on the project list supplied by the Update Status module. Only the properties required by Locale module is included and additional (custom) modules and translation server data is added.

In case the Update Status module is disabled this function will return an empty array.

Return value

array Array of project data:

  • "name": Project system name.
  • "project_type": Project type, e.g. 'module', 'theme'.
  • "core": Core release version, e.g. 8.x
  • "version": Project release version, e.g. 8.x-1.0
  • "server_pattern": Translation server po file pattern.
  • "status": Project status, 1 = enabled.

Deprecated

in drupal:11.4.0 and is removed from drupal:13.0.0. Use \Drupal::service(LocaleProjectRepository::class)->buildProjects() instead.

See also

https://www.drupal.org/node/3037033

File

core/modules/locale/locale.compare.inc, line 57

Code

function locale_translation_build_projects() {
  @trigger_error(__FUNCTION__ . '() is deprecated in drupal:11.4.0 and is removed from drupal:13.0.0. Use \\Drupal::service(LocaleProjectRepository::class)->buildProjects() instead. See https://www.drupal.org/node/3037033', E_USER_DEPRECATED);
  return \Drupal::service(LocaleProjectRepository::class)->buildProjects();
}

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