for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* File containing the Collector class.
*
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
namespace eZ\Bundle\EzPublishCoreBundle\Translation;
* Retrieve all ezplatform translation files installed
class Collector
{
* @var
protected $tranlationPattern;
* @param string $kernelRootDir
public function __construct($kernelRootDir)
$this->tranlationPattern = $kernelRootDir . '/../vendor/ezsystems/ezplatform-i18n-*/*/*.xlf';
}
* @return array
public function collect()
$files = glob($this->tranlationPattern);
$meta = [];
foreach ($files as $file) {
list($domain, $locale, $format) = explode('.', basename($file), 3);
$meta[] = [
'file' => $file,
'domain' => $domain,
'locale' => $locale,
'format' => $format
];
return $meta;