How to get missing translations/messages in Symfony 4, in a controller?

Viewed 1373

My wish : extract missing translations/messages in Symfony 4, in a controller.

I know it's possible, using command lines.

Extract missing translations with command lines

All my translations come from my templates.

I tried to load the object TranslatorInterface

Exemple :

use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Translation\TranslatorInterface;

public function index(TranslatorInterface $translator)
{
    dump($translator);
}

If you have an idea, a bundle to purpose ?

Thanks

1 Answers

you are looking for https://github.com/php-translation/symfony-bundle I guess?

This brings many additional translation functions like an dedicated editor, many commands AND the needed extractors.

One culprit: It only supports xliff format, but existing yaml can be converted easily.

Related