mirror of
https://github.com/shlinkio/shlink.git
synced 2025-02-25 18:45:27 -06:00
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:
parent
7b98527f2e
commit
ce2b28a0b4
@ -3,7 +3,10 @@ APP_ENV=
|
||||
SHORTENED_URL_SCHEMA=
|
||||
SHORTENED_URL_HOSTNAME=
|
||||
SHORTCODE_CHARS=
|
||||
|
||||
# Language
|
||||
DEFAULT_LOCALE=
|
||||
CLI_LOCALE=
|
||||
|
||||
# Database
|
||||
DB_USER=
|
||||
|
7
bin/cli
7
bin/cli
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user