Skip to content

Commit 0bb202a

Browse files
committed
Merge branch '4.1'
* 4.1: [FWBundle] Uniformize errors when a component is missing Fixes 28816 Translation commands should not talk about the old app/ directory since 3.4
2 parents af9f2c2 + 0b313a3 commit 0bb202a

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

Command/TranslationDebugCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ protected function configure()
7676
$this
7777
->setDefinition(array(
7878
new InputArgument('locale', InputArgument::REQUIRED, 'The locale'),
79-
new InputArgument('bundle', InputArgument::OPTIONAL, 'The bundle name or directory where to load the messages, defaults to app/Resources folder'),
79+
new InputArgument('bundle', InputArgument::OPTIONAL, 'The bundle name or directory where to load the messages'),
8080
new InputOption('domain', null, InputOption::VALUE_OPTIONAL, 'The messages domain'),
8181
new InputOption('only-missing', null, InputOption::VALUE_NONE, 'Displays only missing messages'),
8282
new InputOption('only-unused', null, InputOption::VALUE_NONE, 'Displays only unused messages'),
@@ -86,7 +86,7 @@ protected function configure()
8686
->setHelp(<<<'EOF'
8787
The <info>%command.name%</info> command helps finding unused or missing translation
8888
messages and comparing them with the fallback ones by inspecting the
89-
templates and translation files of a given bundle or the app folder.
89+
templates and translation files of a given bundle or the default translations directory.
9090
9191
You can display information about bundle translations in a specific locale:
9292
@@ -104,7 +104,7 @@ protected function configure()
104104
105105
<info>php %command.full_name% --only-unused en AcmeDemoBundle</info>
106106
107-
You can display information about app translations in a specific locale:
107+
You can display information about application translations in a specific locale:
108108
109109
<info>php %command.full_name% en</info>
110110

Command/TranslationUpdateCommand.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ protected function configure()
6565
$this
6666
->setDefinition(array(
6767
new InputArgument('locale', InputArgument::REQUIRED, 'The locale'),
68-
new InputArgument('bundle', InputArgument::OPTIONAL, 'The bundle name or directory where to load the messages, defaults to app/Resources folder'),
68+
new InputArgument('bundle', InputArgument::OPTIONAL, 'The bundle name or directory where to load the messages'),
6969
new InputOption('prefix', null, InputOption::VALUE_OPTIONAL, 'Override the default prefix', '__'),
7070
new InputOption('output-format', null, InputOption::VALUE_OPTIONAL, 'Override the default output format', 'xlf'),
7171
new InputOption('dump-messages', null, InputOption::VALUE_NONE, 'Should the messages be dumped in the console'),
@@ -77,7 +77,7 @@ protected function configure()
7777
->setDescription('Updates the translation file')
7878
->setHelp(<<<'EOF'
7979
The <info>%command.name%</info> command extracts translation strings from templates
80-
of a given bundle or the app folder. It can display them or merge the new ones into the translation files.
80+
of a given bundle or the default translations directory. It can display them or merge the new ones into the translation files.
8181
8282
When new translation strings are found it can automatically add a prefix to the translation
8383
message.
@@ -86,7 +86,7 @@ protected function configure()
8686
<info>php %command.full_name% --dump-messages en AcmeBundle</info>
8787
<info>php %command.full_name% --force --prefix="new_" fr AcmeBundle</info>
8888
89-
Example running against app messages (app/Resources folder)
89+
Example running against default messages directory
9090
<info>php %command.full_name% --dump-messages en</info>
9191
<info>php %command.full_name% --force --prefix="new_" fr</info>
9292
EOF
@@ -128,7 +128,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
128128
if ($this->defaultViewsPath) {
129129
$viewsPaths[] = $this->defaultViewsPath;
130130
}
131-
$currentName = 'app folder';
131+
$currentName = 'default directory';
132132

133133
// Override with provided Bundle info
134134
if (null !== $input->getArgument('bundle')) {

DependencyInjection/FrameworkExtension.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ public function load(array $configs, ContainerBuilder $container)
161161
// translator will be used and everything will still work as expected.
162162
if ($this->isConfigEnabled($container, $config['translator']) || $this->isConfigEnabled($container, $config['form']) || $this->isConfigEnabled($container, $config['validation'])) {
163163
if (!class_exists('Symfony\Component\Translation\Translator') && $this->isConfigEnabled($container, $config['translator'])) {
164-
throw new LogicException('Translation support cannot be enabled as the Translation component is not installed.');
164+
throw new LogicException('Translation support cannot be enabled as the Translation component is not installed. Try running "composer require symfony/translation".');
165165
}
166166

167167
if (class_exists(Translator::class)) {
@@ -218,7 +218,7 @@ public function load(array $configs, ContainerBuilder $container)
218218

219219
if ($this->isConfigEnabled($container, $config['form'])) {
220220
if (!class_exists('Symfony\Component\Form\Form')) {
221-
throw new LogicException('Form support cannot be enabled as the Form component is not installed.');
221+
throw new LogicException('Form support cannot be enabled as the Form component is not installed. Try running "composer require symfony/form".');
222222
}
223223

224224
$this->formConfigEnabled = true;
@@ -238,15 +238,15 @@ public function load(array $configs, ContainerBuilder $container)
238238

239239
if ($this->isConfigEnabled($container, $config['assets'])) {
240240
if (!class_exists('Symfony\Component\Asset\Package')) {
241-
throw new LogicException('Asset support cannot be enabled as the Asset component is not installed.');
241+
throw new LogicException('Asset support cannot be enabled as the Asset component is not installed. Try running "composer require symfony/asset".');
242242
}
243243

244244
$this->registerAssetsConfiguration($config['assets'], $container, $loader);
245245
}
246246

247247
if ($this->isConfigEnabled($container, $config['templating'])) {
248248
if (!class_exists('Symfony\Component\Templating\PhpEngine')) {
249-
throw new LogicException('Templating support cannot be enabled as the Templating component is not installed.');
249+
throw new LogicException('Templating support cannot be enabled as the Templating component is not installed. Try running "composer require symfony/templating".');
250250
}
251251

252252
$this->registerTemplatingConfiguration($config['templating'], $container, $loader);
@@ -274,7 +274,7 @@ public function load(array $configs, ContainerBuilder $container)
274274

275275
if ($this->isConfigEnabled($container, $config['serializer'])) {
276276
if (!class_exists('Symfony\Component\Serializer\Serializer')) {
277-
throw new LogicException('Serializer support cannot be enabled as the Serializer component is not installed.');
277+
throw new LogicException('Serializer support cannot be enabled as the Serializer component is not installed. Try running "composer require symfony/serializer-pack".');
278278
}
279279

280280
$this->registerSerializerConfiguration($config['serializer'], $container, $loader);
@@ -290,7 +290,7 @@ public function load(array $configs, ContainerBuilder $container)
290290

291291
if ($this->isConfigEnabled($container, $config['web_link'])) {
292292
if (!class_exists(HttpHeaderSerializer::class)) {
293-
throw new LogicException('WebLink support cannot be enabled as the WebLink component is not installed.');
293+
throw new LogicException('WebLink support cannot be enabled as the WebLink component is not installed. Try running "composer require symfony/weblink".');
294294
}
295295

296296
$loader->load('web_link.xml');
@@ -497,7 +497,7 @@ private function registerWorkflowConfiguration(array $config, ContainerBuilder $
497497
}
498498

499499
if (!class_exists(Workflow\Workflow::class)) {
500-
throw new LogicException('Workflow support cannot be enabled as the Workflow component is not installed.');
500+
throw new LogicException('Workflow support cannot be enabled as the Workflow component is not installed. Try running "composer require symfony/workflow".');
501501
}
502502

503503
$loader->load('workflow.xml');
@@ -629,11 +629,11 @@ private function registerWorkflowConfiguration(array $config, ContainerBuilder $
629629
}
630630

631631
if (!class_exists(ExpressionLanguage::class)) {
632-
throw new LogicException('Cannot guard workflows as the ExpressionLanguage component is not installed.');
632+
throw new LogicException('Cannot guard workflows as the ExpressionLanguage component is not installed. Try running "composer require symfony/expression-language".');
633633
}
634634

635635
if (!class_exists(Security::class)) {
636-
throw new LogicException('Cannot guard workflows as the Security component is not installed.');
636+
throw new LogicException('Cannot guard workflows as the Security component is not installed. Try running "composer require symfony/security".');
637637
}
638638

639639
$eventName = sprintf('workflow.%s.guard.%s', $name, $transitionName);
@@ -1066,7 +1066,7 @@ private function registerValidationConfiguration(array $config, ContainerBuilder
10661066
}
10671067

10681068
if (!class_exists('Symfony\Component\Validator\Validation')) {
1069-
throw new LogicException('Validation support cannot be enabled as the Validator component is not installed.');
1069+
throw new LogicException('Validation support cannot be enabled as the Validator component is not installed. Try running "composer require symfony/validator".');
10701070
}
10711071

10721072
if (!isset($config['email_validation_mode'])) {

0 commit comments

Comments
 (0)