function 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 with <project name>:<language code>.

See also

locale_translation_source_build()

1 call to locale_translation_build_sources()
_locale_translation_batch_status_operations in drupal/core/modules/locale/locale.compare.inc
Helper function to construct batch operations checking remote translation status.

File

drupal/core/modules/locale/locale.translation.inc, line 131
Common API for interface translation.

Code

function locale_translation_build_sources($projects = array(), $langcodes = array()) {
  $sources = array();
  $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;
}