1 install.core.inc install_find_translation_files($langcode = NULL)

Find 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()

File

core/includes/install.core.inc, line 1314
API functions for installing Backdrop.

Code

function install_find_translation_files($langcode = NULL) {
  $directory = settings_get('locale_translate_file_directory', conf_path() . '/files/translations');
  // @todo: Remove the "drupal" check in 2.x (assuming we have a localization
  // server by then).
  $files = file_scan_directory($directory, '!(install|drupal|backdrop(cms)?)(-[\d\.x]+)?\.' . (!empty($langcode) ? preg_quote($langcode, '!') : '[^\.]+') . '\.po$!', array('recurse' => FALSE));

  return $files;
}