From 1dbf13e43b87883091caf0c5dd2b271ddd484842 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Wed, 1 Feb 2023 16:02:53 +0100 Subject: [PATCH] [FrameworkBundle] Improve documentation about translation:extract --sort option The `--sort` option only works with `--dump-messages` (i.e. not with `--force`). It took me some time to realize that, and the documentation didn't help me since it was showing an example that didn't work. Contribute to https://github.com/symfony/symfony/issues/37918 --- .../FrameworkBundle/Command/TranslationUpdateCommand.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php index f0e1dc8870aa6..7adc0b4bb5568 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php @@ -93,7 +93,7 @@ protected function configure() new InputOption('clean', null, InputOption::VALUE_NONE, 'Should clean not found messages'), new InputOption('domain', null, InputOption::VALUE_OPTIONAL, 'Specify the domain to extract'), new InputOption('xliff-version', null, InputOption::VALUE_OPTIONAL, 'Override the default xliff version (deprecated)'), - new InputOption('sort', null, InputOption::VALUE_OPTIONAL, 'Return list of messages sorted alphabetically', 'asc'), + new InputOption('sort', null, InputOption::VALUE_OPTIONAL, 'Return list of messages sorted alphabetically (only works with --dump-messages)', 'asc'), new InputOption('as-tree', null, InputOption::VALUE_OPTIONAL, 'Dump the messages as a tree-like structure: The given value defines the level where to switch to inline YAML'), ]) ->setDescription(self::$defaultDescription) @@ -123,7 +123,6 @@ protected function configure() You can dump a tree-like structure using the yaml format with --as-tree flag: php %command.full_name% --force --format=yaml --as-tree=3 en AcmeBundle - php %command.full_name% --force --format=yaml --sort=asc --as-tree=3 fr EOF )