function install_find_translation_files

Finds installer translations either for a specific langcode or all languages.

Parameters

$langcode: (optional) The language code corresponding to the language for which we want to find translation files. If omitted, information on all available files will be returned.

Return value

An associative array of file information objects keyed by file URIs as returned by file_scan_directory().

See also

file_scan_directory()

3 calls to install_find_translation_files()
InstallerLanguageTest::testInstallerTranslationFiles in drupal/core/modules/system/lib/Drupal/system/Tests/Common/InstallerLanguageTest.php
Tests that the installer can find translation files.
install_find_translations in drupal/core/includes/install.core.inc
Finds all .po files that are useful to the installer.
st in drupal/core/includes/install.inc
Translates a string when some systems are not available.

File

drupal/core/includes/install.core.inc, line 1310
API functions for installing Drupal.

Code

function install_find_translation_files($langcode = NULL) {
  $directory = variable_get('locale_translate_file_directory', conf_path() . '/files/translations');
  $files = file_scan_directory($directory, '!drupal-\\d+\\.\\d+\\.' . (!empty($langcode) ? preg_quote($langcode, '!') : '[^\\.]+') . '\\.po$!', array(
    'recurse' => FALSE,
  ));
  return $files;
}