22
22
use Symfony \Component \Console \Style \SymfonyStyle ;
23
23
use Symfony \Component \HttpKernel \Bundle \BundleInterface ;
24
24
use Symfony \Component \HttpKernel \KernelInterface ;
25
- use Symfony \Component \Intl \Locales ;
26
25
use Symfony \Component \Translation \Catalogue \MergeOperation ;
27
26
use Symfony \Component \Translation \Catalogue \TargetOperation ;
28
27
use Symfony \Component \Translation \Extractor \ExtractorInterface ;
@@ -60,8 +59,9 @@ class TranslationUpdateCommand extends Command
60
59
private $ defaultViewsPath ;
61
60
private $ transPaths ;
62
61
private $ codePaths ;
62
+ private $ enabledLocales ;
63
63
64
- public function __construct (TranslationWriterInterface $ writer , TranslationReaderInterface $ reader , ExtractorInterface $ extractor , string $ defaultLocale , string $ defaultTransPath = null , string $ defaultViewsPath = null , array $ transPaths = [], array $ codePaths = [])
64
+ public function __construct (TranslationWriterInterface $ writer , TranslationReaderInterface $ reader , ExtractorInterface $ extractor , string $ defaultLocale , string $ defaultTransPath = null , string $ defaultViewsPath = null , array $ transPaths = [], array $ codePaths = [], array $ enabledLocales = [] )
65
65
{
66
66
parent ::__construct ();
67
67
@@ -73,6 +73,7 @@ public function __construct(TranslationWriterInterface $writer, TranslationReade
73
73
$ this ->defaultViewsPath = $ defaultViewsPath ;
74
74
$ this ->transPaths = $ transPaths ;
75
75
$ this ->codePaths = $ codePaths ;
76
+ $ this ->enabledLocales = $ enabledLocales ;
76
77
}
77
78
78
79
/**
@@ -311,7 +312,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
311
312
public function complete (CompletionInput $ input , CompletionSuggestions $ suggestions ): void
312
313
{
313
314
if ($ input ->mustSuggestArgumentValuesFor ('locale ' )) {
314
- $ suggestions ->suggestValues (Locales:: getLocales () );
315
+ $ suggestions ->suggestValues ($ this -> enabledLocales );
315
316
316
317
return ;
317
318
}
0 commit comments