8000 [Translator] Default value for 'sort' option in translation:update should be 'asc' by versgui · Pull Request #35486 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Translator] Default value for 'sort' option in translation:update should be 'asc' #35486

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[Translator] Default value for 'sort' option in translation:update sh…
…ould be 'asc'
  • Loading branch information
Guillaume Verstraete authored and fabpot committed Jan 30, 2020
commit fdb13c8ab83862647cdec53a1c2c90104731ff7a
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,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 update'),
new InputOption('xliff-version', null, InputOption::VALUE_OPTIONAL, 'Override the default xliff version', '1.2'),
new InputOption('sort', null, InputOption::VALUE_OPTIONAL, 'Return list of messages sorted alphabetically'),
new InputOption('sort', null, InputOption::VALUE_OPTIONAL, 'Return list of messages sorted alphabetically', 'asc'),
])
->setDescription('Updates the translation file')
->setHelp(<<<'EOF'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ public function testDumpReverseSortedMessagesAndClean()
$this->assertRegExp('/3 messages were successfully extracted/', $tester->getDisplay());
}

public function testDumpSortWithoutValueAndClean()
{
$tester = $this->createCommandTester(['messages' => ['foo' => 'foo', 'test' => 'test', 'bar' => 'bar']]);
$tester->execute(['command' => 'translation:update', 'locale' => 'en', 'bundle' => 'foo', '--dump-messages' => true, '--clean' => true, '--sort']);
$this->assertRegExp("/\*bar\*foo\*test/", preg_replace('/\s+/', '', $tester->getDisplay()));
$this->assertRegExp('/3 messages were successfully extracted/', $tester->getDisplay());
}

public function testDumpWrongSortAndClean()
{
$tester = $this->createCommandTester(['messages' => ['foo' => 'foo', 'test' => 'test', 'bar' => 'bar']]);
Expand Down
0