src/Classes/ExportLocalizations.php
protected function parseVendorFiles($file, $key, $dir)
    {
        // Base package name without file ending
        $packageName = basename($file, '.php');

        // Get package, language and file contents from language file
        // /vendor/<package>/<language_code>/<filename>.php
        $package = explode(DIRECTORY_SEPARATOR, $file)[2];
        $language = explode(DIRECTORY_SEPARATOR, $file)[3];
        $fileContents = require $dir.DIRECTORY_SEPARATOR.$file;

        // Check if language already exists in array
        if (array_key_exists($language, $this->strings)) {
            // Check if package already exists in language
            if (array_key_exists($package, $this->strings[$language])) {
                if (array_key_exists($packageName, $this->strings[$language][$package])) {
                    $this->strings[$language][$package][$packageName] =
                        array_replace_recursive((array) $this->strings[$language][$package][$packageName],
                            (array)
                            $fileContents);
                } else {
                    $this->strings[$language][$package][$packageName] = $fileContents;
                }
            } else {
                $this->strings[$language][$package] = [$packageName => $fileContents];
            }
        } else {
            $this->strings[$language] = [

                $package => [

                    $packageName => $fileContents,
                ],
            ];
        }
    }
protected function parseVendorFiles($file, $key, $dir)
    {
        // Base package name without file ending
        $packageName = basename($file, '.php');

        // Get package, language and file contents from language file
        // /vendor/<package>/<language_code>/<filename>.php
        $package = explode(DIRECTORY_SEPARATOR, $file)[2];
        $language = explode(DIRECTORY_SEPARATOR, $file)[3];
        $fileContents = require $dir.DIRECTORY_SEPARATOR.$file;

        // Check if language already exists in array
        if (array_key_exists($language, $this->strings)) {
            // Check if package already exists in language
            if (array_key_exists($package, $this->strings[$language])) {
                if (array_key_exists($packageName, $this->strings[$language][$package])) {
                    $this->strings[$language][$package][$packageName] =
                        array_replace_recursive((array) $this->strings[$language][$package][$packageName],
                            (array)
                            $fileContents);
                } else {
                    $this->strings[$language][$package][$packageName] = $fileContents;
                }
            } else {
                $this->strings[$language][$package] = [$packageName => $fileContents];
            }
        } else {
            $this->strings[$language] = [

                $package => [

                    $packageName => $fileContents,
                ],
            ];
        }
    }
protected function parseVendorFiles ( $ file , $ key , $ dir ) { // Base package name without file ending $ packageName = basename ( $ file , '.php' ) ; // Get package, language and file contents from language file // /vendor/<package>/<language_code>/<filename>.php $ package = explode ( DIRECTORY_SEPARATOR , $ file ) [ 2 ] ; $ language = explode ( DIRECTORY_SEPARATOR , $ file ) [ 3 ] ; $ fileContents = require $ dir . DIRECTORY_SEPARATOR . $ file ; // Check if language already exists in array if ( array_key_exists ( $ language , $ this -> strings ) ) { // Check if package already exists in language if ( array_key_exists ( $ package , $ this -> strings [ $ language ] ) ) { if ( array_key_exists ( $ packageName , $ this -> strings [ $ language ] [ $ package ] ) ) { $ this -> strings [ $ language ] [ $ package ] [ $ packageName ] = array_replace_recursive ( ( array ) $ this -> strings [ $ language ] [ $ package ] [ $ packageName ] , ( array ) $ fileContents ) ; } else { $ this -> strings [ $ language ] [ $ package ] [ $ packageName ] = $ fileContents ; } } else { $ this -> strings [ $ language ] [ $ package ] = [ $ packageName => $ fileContents ] ; } } else { $ this -> strings [ $ language ] = [ $ package => [ $ packageName => $ fileContents , ] , ] ; } }
Method to parse language files from vendor folder.

@param string $file
Method to parse language files from vendor folder .