function locale_translate_get_interface_translation_files

Get an array of available interface translation file.

Parameters

$langcode: The langcode for the interface translation files. Pass NULL to get all available interface translation files.

Return value

array An array of interface translation files.

2 calls to locale_translate_get_interface_translation_files()
locale_translate_batch_import_files in drupal/core/modules/locale/locale.bulk.inc
Prepare a batch to import all translations.
locale_translate_delete_translation_files in drupal/core/modules/locale/locale.bulk.inc
Deletes all interface translation files depending on the langcode.

File

drupal/core/modules/locale/locale.bulk.inc, line 364
Mass import-export and batch import functionality for Gettext .po files.

Code

function locale_translate_get_interface_translation_files($langcode = NULL) {
  $directory = variable_get('locale_translate_file_directory', conf_path() . '/files/translations');
  $return = file_scan_directory($directory, '!' . (!empty($langcode) ? '\\.' . preg_quote($langcode, '!') : '') . '\\.po$!', array(
    'recurse' => FALSE,
  ));
  foreach ($return as $filepath => $file) {
    $file->uri = 'translations://' . $file->filename;
    $return[$file->uri] = $file;
    unset($return[$filepath]);
  }
  return $return;
}