[FrameworkBundle] Deprecate useless --no-prefix option
This commit is contained in:
parent
cc2363fa6c
commit
f7afa777d8
@ -34,6 +34,10 @@ FrameworkBundle
|
|||||||
* The `KernelTestCase::getPhpUnitXmlDir()` and `KernelTestCase::getPhpUnitCliConfigArgument()`
|
* The `KernelTestCase::getPhpUnitXmlDir()` and `KernelTestCase::getPhpUnitCliConfigArgument()`
|
||||||
methods are deprecated since 3.4 and will be removed in 4.0.
|
methods are deprecated since 3.4 and will be removed in 4.0.
|
||||||
|
|
||||||
|
* The `--no-prefix` option of the `translation:update` command is deprecated and
|
||||||
|
will be removed in 4.0. Use the `--prefix` option with an empty string as value
|
||||||
|
instead (e.g. `--prefix=""`)
|
||||||
|
|
||||||
Process
|
Process
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
@ -345,6 +345,9 @@ FrameworkBundle
|
|||||||
* The `Symfony\Bundle\FrameworkBundle\Validator\ConstraintValidatorFactory` class has been removed.
|
* The `Symfony\Bundle\FrameworkBundle\Validator\ConstraintValidatorFactory` class has been removed.
|
||||||
Use `Symfony\Component\Validator\ContainerConstraintValidatorFactory` instead.
|
Use `Symfony\Component\Validator\ContainerConstraintValidatorFactory` instead.
|
||||||
|
|
||||||
|
* The `--no-prefix` option of the `translation:update` command has
|
||||||
|
been removed.
|
||||||
|
|
||||||
HttpFoundation
|
HttpFoundation
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ class TranslationUpdateCommand extends ContainerAwareCommand
|
|||||||
new InputArgument('locale', InputArgument::REQUIRED, 'The locale'),
|
new InputArgument('locale', InputArgument::REQUIRED, 'The locale'),
|
||||||
new InputArgument('bundle', InputArgument::OPTIONAL, 'The bundle name or directory where to load the messages, defaults to app/Resources folder'),
|
new InputArgument('bundle', InputArgument::OPTIONAL, 'The bundle name or directory where to load the messages, defaults to app/Resources folder'),
|
||||||
new InputOption('prefix', null, InputOption::VALUE_OPTIONAL, 'Override the default prefix', '__'),
|
new InputOption('prefix', null, InputOption::VALUE_OPTIONAL, 'Override the default prefix', '__'),
|
||||||
new InputOption('no-prefix', null, InputOption::VALUE_NONE, 'If set, no prefix is added to the translations'),
|
new InputOption('no-prefix', null, InputOption::VALUE_NONE, '[DEPRECATED] If set, no prefix is added to the translations'),
|
||||||
new InputOption('output-format', null, InputOption::VALUE_OPTIONAL, 'Override the default output format', 'yml'),
|
new InputOption('output-format', null, InputOption::VALUE_OPTIONAL, 'Override the default output format', 'yml'),
|
||||||
new InputOption('dump-messages', null, InputOption::VALUE_NONE, 'Should the messages be dumped in the console'),
|
new InputOption('dump-messages', null, InputOption::VALUE_NONE, 'Should the messages be dumped in the console'),
|
||||||
new InputOption('force', null, InputOption::VALUE_NONE, 'Should the update be done'),
|
new InputOption('force', null, InputOption::VALUE_NONE, 'Should the update be done'),
|
||||||
@ -135,7 +135,13 @@ EOF
|
|||||||
$extractedCatalogue = new MessageCatalogue($input->getArgument('locale'));
|
$extractedCatalogue = new MessageCatalogue($input->getArgument('locale'));
|
||||||
$errorIo->comment('Parsing templates...');
|
$errorIo->comment('Parsing templates...');
|
||||||
$extractor = $this->getContainer()->get('translation.extractor');
|
$extractor = $this->getContainer()->get('translation.extractor');
|
||||||
$extractor->setPrefix($input->getOption('no-prefix') ? '' : $input->getOption('prefix'));
|
$prefix = $input->getOption('prefix');
|
||||||
|
// @deprecated since version 3.4, to be removed in 4.0 along with the --no-prefix option
|
||||||
|
if ($input->getOption('no-prefix')) {
|
||||||
|
@trigger_error('The "--no-prefix" option is deprecated since version 3.4 and will be removed in 4.0. Use the "--prefix" option with an empty string as value instead.', E_USER_DEPRECATED);
|
||||||
|
$prefix = '';
|
||||||
|
}
|
||||||
|
$extractor->setPrefix($prefix);
|
||||||
foreach ($transPaths as $path) {
|
foreach ($transPaths as $path) {
|
||||||
$path .= 'views';
|
$path .= 'views';
|
||||||
if (is_dir($path)) {
|
if (is_dir($path)) {
|
||||||
|
Reference in New Issue
Block a user