@@ -83,17 +83,31 @@ protected function execute(InputInterface $input, OutputInterface $output)
83
83
{
84
84
$ locale = $ input ->getArgument ('locale ' );
85
85
$ domain = $ input ->getOption ('domain ' );
86
- $ bundle = $ this ->getContainer ()->get ('kernel ' )->getBundle ($ input ->getArgument ('bundle ' ));
86
+ $ kernel = $ this ->getContainer ()->get ('kernel ' );
87
+ $ bundle = $ kernel ->getBundle ($ input ->getArgument ('bundle ' ));
87
88
$ loader = $ this ->getContainer ()->get ('translation.loader ' );
88
89
89
90
// Extract used messages
90
91
$ extractedCatalogue = new MessageCatalogue ($ locale );
91
- $ this ->getContainer ()->get ('translation.extractor ' )->extract ($ bundle ->getPath ().'/Resources/views ' , $ extractedCatalogue );
92
+ $ bundlePaths = array (
93
+ $ bundle ->getPath ().'/Resources/ ' ,
94
+ sprintf ('%s/Resources/%s/ ' , $ kernel ->getRootDir (), $ bundle ->getName ()),
95
+ );
96
+
97
+ foreach ($ bundlePaths as $ path ) {
98
+ $ path = $ path .'views ' ;
99
+ if (is_dir ($ path )) {
100
+ $ this ->getContainer ()->get ('translation.extractor ' )->extract ($ path , $ extractedCatalogue );
101
+ }
102
+ }
92
103
93
104
// Load defined messages
94
105
$ currentCatalogue = new MessageCatalogue ($ locale );
95
- if (is_dir ($ bundle ->getPath ().'/Resources/translations ' )) {
96
- $ loader ->loadMessages ($ bundle ->getPath ().'/Resources/translations ' , $ currentCatalogue );
106
+ foreach ($ bundlePaths as $ path ) {
107
+ $ path = $ path .'translations ' ;
108
+ if (is_dir ($ path )) {
109
+ $ loader ->loadMessages ($ path , $ currentCatalogue );
110
+ }
97
111
}
98
112
99
113
// Merge defined and extracted messages to get all message ids
0 commit comments