Closed
Description
Symfony version(s) affected: 4.3.2
Description
According to @javiereguiluz's comment #32686 (comment), I don't have to clear the cache anymore even if you create new files.
How to reproduce
-
Create a new Symfony demo project
composer create-project symfony/symfony-demo symfony-demo
-
Create the
App\Command\DummyCommand
<?php
namespace App\Command;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
class DummyCommand extends Command
{
protected static $defaultName = 'dummy';
/**
* @var TranslatorInterface
*/
private $translator;
public function __construct(TranslatorInterface $translator)
{
$this->translator = $translator;
parent::__construct();
}
protected function execute(InputInterface $input, OutputInterface $output): void
{
$output->writeln($this->translator->trans('dummy', [], 'dummy'));
}
}
-
Run the command
php bin/console dummy
.
It outputs "dummy" => OK -
Create
translations/dummy+intl-icu.yml
with this content:
dummy: Hello
-
Run the command
php bin/console dummy
.
It outputs "dummy" => KO
Expected output is "Hello" -
Clear the cache
php bin/console cache:clear
-
Run the command
php bin/console dummy
.
It outputs "Hello" => OK