File tree Expand file tree Collapse file tree 1 file changed +4
-10
lines changed
Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -123,16 +123,10 @@ protected function registerTranslations(): void
123123 return ;
124124 }
125125
126- $ path = implode (DIRECTORY_SEPARATOR , [
127- $ this ->app ['config ' ]->get ('modules.paths.modules ' ),
128- '* ' ,
129- 'lang ' ,
130- ]);
131-
132- collect (glob ($ path , GLOB_ONLYDIR ))
133- ->each (function (string $ path ) use ($ translator ) {
134- preg_match ('/\/([^\/]+)\/lang/ ' , $ path , $ matches );
135- $ translator ->addNamespace (strtolower ($ matches [1 ]), $ path );
126+ collect (\Nwidart \Modules \Facades \Module::allEnabled ())
127+ ->each (function (\Nwidart \Modules \Laravel \Module $ module ) use ($ translator ) {
128+ $ path = $ module ->getExtraPath ($ this ->app ['config ' ]->get ('modules.paths.generator.lang.path ' ));
129+ $ translator ->addNamespace ($ module ->getLowerName (), $ path );
136130 $ translator ->addJsonPath ($ path );
137131 });
138132 });
You can’t perform that action at this time.
0 commit comments