Improved cli entry point so that the language is set to the translator based on the CLI_LANGUAGE env var

This commit is contained in:
Alejandro Celaya
2016-08-01 20:44:45 +02:00
parent 7b98527f2e
commit ce2b28a0b4
2 changed files with 10 additions and 0 deletions

View File

@@ -2,9 +2,16 @@
<?php
use Interop\Container\ContainerInterface;
use Symfony\Component\Console\Application as CliApp;
use Symfony\Component\Console\Application;
use Zend\I18n\Translator\Translator;
/** @var ContainerInterface $container */
$container = include __DIR__ . '/../config/container.php';
/** @var Translator $translator */
$translator = $container->get('translator');
$translator->setLocale(env('CLI_LOCALE', 'en'));
/** @var Application $app */
$app = $container->get(CliApp::class);
$app->run();