8000 [Translator] New files are ignored until the cache is cleared · Issue #32706 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
[Translator] New files are ignored until the cache is cleared #32706
Closed
@sylfabre

Description

@sylfabre

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

  1. Create a new Symfony demo project
    composer create-project symfony/symfony-demo symfony-demo

  2. 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'));
    }
}
  1. Run the command php bin/console dummy.
    It outputs "dummy" => OK

  2. Create translations/dummy+intl-icu.yml with this content:
    dummy: Hello

  3. Run the command php bin/console dummy.
    It outputs "dummy" => KO
    Expected output is "Hello"

  4. Clear the cache php bin/console cache:clear

  5. Run the command php bin/console dummy.
    It outputs "Hello" => OK

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0