@@ -162,12 +162,15 @@ protected function execute(InputInterface $input, OutputInterface $output)
162
162
if (null !== $ input ->getArgument ('bundle ' )) {
163
163
try {
164
164
$ bundle = $ kernel ->getBundle ($ input ->getArgument ('bundle ' ));
165
+ $ transPaths = [$ bundle ->getPath ().'/Resources/translations ' ];
166
+ $ viewsPaths = [$ bundle ->getPath ().'/Resources/views ' ];
165
167
if (method_exists ($ bundle , 'getBundleDir ' )) {
166
- $ transPaths = [$ bundle ->getBundleDir ().'/translations ' ];
167
- $ viewsPaths = [$ bundle ->getBundleDir ().'/templates ' ];
168
- } else {
169
- $ transPaths = [$ bundle ->getPath ().'/Resources/translations ' ];
170
- $ viewsPaths = [$ bundle ->getPath ().'/Resources/views ' ];
168
+ if (is_dir ($ bundle ->getBundleDir ().'/translations ' )) {
169
+ $ transPaths = [$ bundle ->getBundleDir ().'/translations ' ];
170
+ }
171
+ if (is_dir ($ bundle ->getBundleDir ().'/templates ' )) {
172
+ $ viewsPaths = [$ bundle ->getBundleDir ().'/templates ' ];
173
+ }
171
174
}
172
175
if ($ this ->defaultTransPath ) {
173
176
$ transPaths [] = $ this ->defaultTransPath ;
@@ -211,11 +214,14 @@ protected function execute(InputInterface $input, OutputInterface $output)
211
214
}
212
215
} elseif ($ input ->getOption ('all ' )) {
213
216
foreach ($ kernel ->getBundles () as $ bundle ) {
214
- if (method_exists ($ bundle , 'getBundleDir ' )) {
217
+ if (method_exists ($ bundle , 'getBundleDir ' ) && is_dir ( $ bundle -> getBundleDir (). ' /translations ' ) ) {
215
218
$ transPaths [] = $ bundle ->getBundleDir ().'/translations ' ;
216
- $ viewsPaths [] = $ bundle ->getBundleDir ().'/templates ' ;
217
219
} else {
218
220
$ transPaths [] = $ bundle ->getPath ().'/Resources/translations ' ;
221
+ }
222
+ if (method_exists ($ bundle , 'getBundleDir ' ) && is_dir ($ bundle ->getBundleDir ().'/templates ' )) {
223
+ $ viewsPaths [] = $ bundle ->getBundleDir ().'/templates ' ;
224
+ } else {
219
225
$ viewsPaths [] = $ bundle ->getPath ().'/Resources/views ' ;
220
226
}
221
227
if (is_dir ($ deprecatedPath = sprintf ('%s/Resources/%s/translations ' , $ rootDir , $ bundle ->getName ()))) {
0 commit comments