public static FileTranslation::filesToArray($langcode, array $files)
Reads the given Gettext PO files into a data structure.
string $langcode: Language code string.
array $files: List of file objects with URI properties pointing to read.
array Structured array as produced by a PoMemoryWriter.
\Drupal\Component\Gettext\PoMemoryWriter
public static function filesToArray($langcode, array $files) { $writer = new PoMemoryWriter(); $writer->setLangcode($langcode); foreach ($files as $file) { $reader = new PoStreamReader(); $reader->setURI($file->uri); $reader->setLangcode($langcode); $reader->open(); $writer->writeItems($reader, -1); } return $writer->getData(); }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!StringTranslation!Translator!FileTranslation.php/function/FileTranslation::filesToArray/8.1.x