FileTranslation::findTranslationFiles

public FileTranslation::findTranslationFiles($langcode = NULL)

Finds installer translations either for a specific or all languages.

Filenames must match the pattern:

  • 'drupal-[version].[langcode].po (if langcode is provided)
  • 'drupal-[version].*.po (if no langcode is provided)

Parameters

string $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

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

See also

file_scan_directory()

File

core/lib/Drupal/Core/StringTranslation/Translator/FileTranslation.php, line 72

Class

FileTranslation
File based string translation.

Namespace

Drupal\Core\StringTranslation\Translator

Code

public function findTranslationFiles($langcode = NULL) {
  $files = file_scan_directory($this->directory, $this->getTranslationFilesPattern($langcode), array('recurse' => FALSE));
  return $files;
}
doc_Drupal
2016-10-29 09:14:03
Comments
Leave a Comment

Please login to continue.