8000 update locale completion · symfony/symfony@bfd516f · GitHub
[go: up one dir, main page]

Skip to content

Commit bfd516f

Browse files
committed
update locale completion
1 parent 6e3598b commit bfd516f

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
use Symfony\Component\Console\Style\SymfonyStyle;
2323
use Symfony\Component\HttpKernel\Bundle\BundleInterface;
2424
use Symfony\Component\HttpKernel\KernelInterface;
25+
use Symfony\Component\Intl\Locales;
2526
use Symfony\Component\Translation\Catalogue\MergeOperation;
2627
use Symfony\Component\Translation\Catalogue\TargetOperation;
2728
use Symfony\Component\Translation\Extractor\ExtractorInterface;
@@ -310,6 +311,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
310311
public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void
311312
{
312313
if ($input->mustSuggestArgumentValuesFor('locale')) {
314+
$suggestions->suggestValues(Locales::getLocales());
313315
return;
314316
}
315317

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use Symfony\Component\Filesystem\Filesystem;
2121
use Symfony\Component\HttpKernel\Bundle\BundleInterface;
2222
use Symfony\Component\HttpKernel\KernelInterface;
23+
use Symfony\Component\Intl\Locales;
2324
use Symfony\Component\Translation\Extractor\ExtractorInterface;
2425
use Symfony\Component\Translation\Reader\TranslationReader;
2526
use Symfony\Component\Translation\Translator;
@@ -44,6 +45,7 @@ public function testComplete(array $input, array $expectedSuggestions)
4445

4546
public function provideCompletionSuggestions()
4647
{
48+
yield 'locale' => [[''], Locales::getLocales()];
4749
yield 'bundle' => [['en', ''], ['BaseBundle']];
4850
yield 'domain with locale' => [['en', '--domain=m'], ['messages']];
4951
yield 'domain without locale' => [['--domain=m'], []];

0 commit comments

Comments
 (0)
0