function locale_translation_build_sources

Same name in other branches
  1. 9 core/modules/locale/locale.translation.inc \locale_translation_build_sources()
  2. 8.9.x core/modules/locale/locale.translation.inc \locale_translation_build_sources()
  3. 10 core/modules/locale/locale.translation.inc \locale_translation_build_sources()

Build translation sources.

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 by project name and language code.

See also

locale_translation_source_build()

1 call to locale_translation_build_sources()
locale_translation_get_status in core/modules/locale/locale.module
Gets the current translation status.

File

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

Code

function locale_translation_build_sources(array $projects = [], array $langcodes = []) {
    $sources = [];
    $projects = locale_translation_get_projects($projects);
    $langcodes = $langcodes ? $langcodes : array_keys(locale_translatable_language_list());
    foreach ($projects as $project) {
        foreach ($langcodes as $langcode) {
            $source = locale_translation_source_build($project, $langcode);
            $sources[$source->name][$source->langcode] = $source;
        }
    }
    return $sources;
}

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