function locale_translation_load_sources

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

Loads cached translation sources containing current translation status.

Parameters

array $projects: Array of project names. Defaults to all translatable projects.

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

Return value

array Array of source objects. Keyed with <project name>:<language code>.

Deprecated

in drupal:11.4.0 and is removed from drupal:13.0.0. Use \Drupal::service(LocaleSource::class) ->loadSources($projects, $langcodes) instead.

See also

locale_translation_source_build()

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

File

core/modules/locale/locale.translation.inc, line 115

Code

function locale_translation_load_sources(?array $projects = NULL, ?array $langcodes = NULL) : array {
  @trigger_error(__FUNCTION__ . '() is deprecated in drupal:11.4.0 and is removed from drupal:13.0.0. Use \\Drupal::service(LocaleSource::class)->loadSources($projects, $langcodes) instead. See https://www.drupal.org/node/3569330', E_USER_DEPRECATED);
  return \Drupal::service(LocaleSource::class)->loadSources($projects, $langcodes);
}

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