The Translation component provides tools to internationalize your application.
$ composer require symfony/translation
use Symfony\Component\Translation\Translator;
$translator = new Translator('fr_FR');
$translator->addResource('array', [
'Hello World!' => 'Bonjour !',
], 'fr_FR');
echo $translator->trans('Hello World!'); // outputs « Bonjour ! »