8000 only suggest domain when locale is already typed · symfony/symfony@6e3598b · GitHub
[go: up one dir, main page]

Skip to content

Commit 6e3598b

Browse files
committed
only suggest domain when locale is already typed
1 parent 03000d7 commit 6e3598b

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -332,9 +332,7 @@ public function complete(CompletionInput $input, CompletionSuggestions $suggesti
332332
return;
333333
}
334334

335-
if ($input->mustSuggestOptionValuesFor('domain')) {
336-
$locale = $input->getArgument('locale');
337-
335+
if ($input->mustSuggestOptionValuesFor('domain') && $locale = $input->getArgument('locale')) {
338336
$extractedCatalogue = $this->extractMessages($locale, $this->getRootCodePaths($kernel), $input->getOption('prefix'));
339337

340338
$currentCatalogue = $this->loadCurrentMessages($locale, $this->getRootTransPaths());

src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationUpdateCommandCompletionTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ public function testComplete(array $input, array $expectedSuggestions)
4545
public function provideCompletionSuggestions()
4646
{
4747
yield 'bundle' => [['en', ''], ['BaseBundle']];
48-
yield 'domain' => [['en', '--domain=m'], ['messages']];
48+
yield 'domain with locale' => [['en', '--domain=m'], ['messages']];
49+
yield 'domain without locale' => [['--domain=m'], []];
4950
yield 'format' => [['en', '--format='], ['php', 'xlf', 'po', 'mo', 'yml', 'yaml', 'ts', 'csv', 'ini', 'json', 'res', 'xlf12', 'xlf20']];
5051
yield 'sort' => [['en', '--sort='], ['asc', 'desc']];
5152
}

0 commit comments

Comments
 (0)
0