mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-09 02:54:26 +00:00
52 lines
1.5 KiB
PHP
52 lines
1.5 KiB
PHP
<?php
|
|
|
|
/*
|
|
* This file is part of Phraseanet
|
|
*
|
|
* (c) 2005-2014 Alchemy
|
|
*
|
|
* For the full copyright and license information, please view the LICENSE
|
|
* file that was distributed with this source code.
|
|
*/
|
|
|
|
namespace Alchemy\Phrasea\Command\Developer;
|
|
|
|
use Alchemy\Phrasea\Command\Command;
|
|
use JMS\TranslationBundle\Translation\ConfigBuilder;
|
|
use Symfony\Component\Console\Input\InputInterface;
|
|
use Symfony\Component\Console\Output\OutputInterface;
|
|
|
|
class TranslationDumper extends Command
|
|
{
|
|
public function __construct()
|
|
{
|
|
parent::__construct('translation:dump');
|
|
|
|
$this->setDescription('Dump translation files');
|
|
}
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
protected function doExecute(InputInterface $input, OutputInterface $output)
|
|
{
|
|
foreach (array_keys($this->container->getAvailableLanguages()) as $code) {
|
|
$builder = new ConfigBuilder();
|
|
$config = $builder->setLocale($code)
|
|
->setOutputFormat('xlf')
|
|
->setTranslationsDir(__DIR__ . '/../../../../../resources/locales')
|
|
->setScanDirs([
|
|
$this->container['root.path'].'/lib',
|
|
$this->container['root.path'].'/templates',
|
|
$this->container['root.path'].'/bin',
|
|
$this->container['root.path'].'/www',
|
|
])
|
|
->getConfig();
|
|
|
|
$this->container['translation-extractor.updater']->process($config);
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
}
|