diff --git a/plugins/LanguagesManager/Commands/FetchTranslations.php b/plugins/LanguagesManager/Commands/FetchTranslations.php index 79f83da36dfdcfbc6c4e754d9b944a34392677d6..ce24dc3a976a58c3298ca6673ef2d8e3f838694b 100644 --- a/plugins/LanguagesManager/Commands/FetchTranslations.php +++ b/plugins/LanguagesManager/Commands/FetchTranslations.php @@ -13,7 +13,7 @@ use Piwik\Container\StaticContainer; use Piwik\Exception\AuthenticationFailedException; use Piwik\Plugins\LanguagesManager\API as LanguagesManagerApi; use Piwik\Translation\Transifex\API; -use Symfony\Component\Console\Helper\ProgressHelper; +use Symfony\Component\Console\Helper\ProgressBar; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; @@ -38,6 +38,8 @@ class FetchTranslations extends TranslationBase protected function execute(InputInterface $input, OutputInterface $output) { + $output->setDecorated(true); + $username = $input->getOption('username'); $password = $input->getOption('password'); $plugin = $input->getOption('plugin'); @@ -81,10 +83,10 @@ class FetchTranslations extends TranslationBase $languages = $languageCodes; } - /** @var ProgressHelper $progress */ - $progress = $this->getHelperSet()->get('progress'); + /** @var ProgressBar $progress */ + $progress = new ProgressBar($output, count($languages)); - $progress->start($output, count($languages)); + $progress->start(); $statistics = $transifexApi->getStatistics($resource); @@ -108,6 +110,7 @@ class FetchTranslations extends TranslationBase } $progress->finish(); + $output->writeln(''); } public static function getDownloadPath() diff --git a/plugins/LanguagesManager/Commands/Update.php b/plugins/LanguagesManager/Commands/Update.php index d28b979046950006af8526147da7a3b61ff168e1..375614c5dba96f0d6376a2da28aa24c372f26b15 100644 --- a/plugins/LanguagesManager/Commands/Update.php +++ b/plugins/LanguagesManager/Commands/Update.php @@ -11,12 +11,12 @@ namespace Piwik\Plugins\LanguagesManager\Commands; use Piwik\Plugins\LanguagesManager\API; use Symfony\Component\Console\Helper\DialogHelper; -use Symfony\Component\Console\Helper\ProgressHelper; use Symfony\Component\Console\Input\ArrayInput; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\NullOutput; use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Helper\ProgressBar; /** */ @@ -34,6 +34,8 @@ class Update extends TranslationBase protected function execute(InputInterface $input, OutputInterface $output) { + $output->setDecorated(true); + $start = microtime(true); /** @var DialogHelper $dialog */ @@ -76,10 +78,10 @@ class Update extends TranslationBase $output->writeln("Starting to import new language files"); - /** @var ProgressHelper $progress */ - $progress = $this->getHelperSet()->get('progress'); + /** @var ProgressBar $progress */ + $progress = new ProgressBar($output, count($files)); - $progress->start($output, count($files)); + $progress->start(); foreach ($files as $filename) { @@ -119,6 +121,7 @@ class Update extends TranslationBase } $progress->finish(); + $output->writeln(''); } $output->writeln("Finished in " . round(microtime(true)-$start, 3) . "s");