@@ -55,9 +55,9 @@ class TranslationDebugCommand extends Command
55
55
private $ defaultTransPath ;
56
56
private $ defaultViewsPath ;
57
57
private $ transPaths ;
58
- private $ viewsPaths ;
58
+ private $ codePaths ;
59
59
60
- public function __construct (TranslatorInterface $ translator , TranslationReaderInterface $ reader , ExtractorInterface $ extractor , string $ defaultTransPath = null , string $ defaultViewsPath = null , array $ transPaths = [], array $ viewsPaths = [])
60
+ public function __construct (TranslatorInterface $ translator , TranslationReaderInterface $ reader , ExtractorInterface $ extractor , string $ defaultTransPath = null , string $ defaultViewsPath = null , array $ transPaths = [], array $ codePaths = [])
61
61
{
62
62
parent ::__construct ();
63
63
@@ -67,7 +67,7 @@ public function __construct(TranslatorInterface $translator, TranslationReaderIn
67
67
$ this ->defaultTransPath = $ defaultTransPath ;
68
68
$ this ->defaultViewsPath = $ defaultViewsPath ;
69
69
$ this ->transPaths = $ transPaths ;
70
- $ this ->viewsPaths = $ viewsPaths ;
70
+ $ this ->codePaths = $ codePaths ;
71
71
}
72
72
73
73
/**
@@ -139,10 +139,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int
139
139
if ($ this ->defaultTransPath ) {
140
140
$ transPaths [] = $ this ->defaultTransPath ;
141
141
}
142
- $ viewsPaths = $ this ->viewsPaths ;
143
- $ viewsPaths [] = $ kernel ->getProjectDir ().'/src ' ;
142
+ $ codePaths = $ this ->codePaths ;
143
+ $ codePaths [] = $ kernel ->getProjectDir ().'/src ' ;
144
144
if ($ this ->defaultViewsPath ) {
145
- $ viewsPaths [] = $ this ->defaultViewsPath ;
145
+ $ codePaths [] = $ this ->defaultViewsPath ;
146
146
}
147
147
148
148
// Override with provided Bundle info
@@ -151,19 +151,19 @@ protected function execute(InputInterface $input, OutputInterface $output): int
151
151
$ bundle = $ kernel ->getBundle ($ input ->getArgument ('bundle ' ));
152
152
$ bundleDir = $ bundle ->getPath ();
153
153
$ transPaths = [is_dir ($ bundleDir .'/Resources/translations ' ) ? $ bundleDir .'/Resources/translations ' : $ bundleDir .'/translations ' ];
154
- $ viewsPaths = [is_dir ($ bundleDir .'/Resources/views ' ) ? $ bundleDir .'/Resources/views ' : $ bundleDir .'/templates ' ];
154
+ $ codePaths = [is_dir ($ bundleDir .'/Resources/views ' ) ? $ bundleDir .'/Resources/views ' : $ bundleDir .'/templates ' ];
155
155
if ($ this ->defaultTransPath ) {
156
156
$ transPaths [] = $ this ->defaultTransPath ;
157
157
}
158
158
if ($ this ->defaultViewsPath ) {
159
- $ viewsPaths [] = $ this ->defaultViewsPath ;
159
+ $ codePaths [] = $ this ->defaultViewsPath ;
160
160
}
161
161
} catch (\InvalidArgumentException $ e ) {
162
162
// such a bundle does not exist, so treat the argument as path
163
163
$ path = $ input ->getArgument ('bundle ' );
164
164
165
165
$ transPaths = [$ path .'/translations ' ];
166
- $ viewsPaths = [$ path .'/templates ' ];
166
+ $ codePaths = [$ path .'/templates ' ];
167
167
168
168
if (!is_dir ($ transPaths [0 ]) && !isset ($ transPaths [1 ])) {
169
169
throw new InvalidArgumentException (sprintf ('"%s" is neither an enabled bundle nor a directory. ' , $ transPaths [0 ]));
@@ -173,12 +173,12 @@ protected function execute(InputInterface $input, OutputInterface $output): int
173
173
foreach ($ kernel ->getBundles () as $ bundle ) {
174
174
$ bundleDir = $ bundle ->getPath ();
175
175
$ transPaths [] = is_dir ($ bundleDir .'/Resources/translations ' ) ? $ bundleDir .'/Resources/translations ' : $ bundle ->getPath ().'/translations ' ;
176
- $ viewsPaths [] = is_dir ($ bundleDir .'/Resources/views ' ) ? $ bundleDir .'/Resources/views ' : $ bundle ->getPath ().'/templates ' ;
176
+ $ codePaths [] = is_dir ($ bundleDir .'/Resources/views ' ) ? $ bundleDir .'/Resources/views ' : $ bundle ->getPath ().'/templates ' ;
177
177
}
178
178
}
179
179
180
180
// Extract used messages
181
- $ extractedCatalogue = $ this ->extractMessages ($ locale , $ viewsPaths );
181
+ $ extractedCatalogue = $ this ->extractMessages ($ locale , $ codePaths );
182
182
183
183
// Load defined messages
184
184
$ currentCatalogue = $ this ->loadCurrentMessages ($ locale , $ transPaths );
0 commit comments