File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -53,10 +53,17 @@ private function setTranslations()
5353 $ path = $ file ->getRelativePathName ();
5454 $ this ->printFileCompiled ($ path );
5555 $ delimiter = strpos ($ path , '/ ' ) !== false ? '/ ' : '\\' ;
56+
5657 $ array = array_map (function ($ key ) use ($ file ) {
5758 return str_replace ('. ' . $ file ->getExtension (), '' , $ key );
5859 }, explode ($ delimiter , $ path ));
59- $ nestedArray = $ this ->addArrayLevels ($ array , [], require $ file ->getPathName ());
60+
61+ $ nestedArray = $ this ->addArrayLevels ($ array , [],
62+ $ file ->getExtension () === 'json '
63+ ? json_decode (file_get_contents ($ file ->getPathName ()), true )
64+ : require $ file ->getPathName ()
65+ );
66+
6067 $ this ->translations = array_merge_recursive ($ this ->translations , $ nestedArray );
6168 }
6269 }
You can’t perform that action at this time.
0 commit comments