public function read($locale, array $excluded = [])
    {
        // Empty our translations for a new read
        $this->translations = collect();

        $files = $this->filesystem->listContents($locale);

        foreach ($files as $file) {
            $filename = substr($file['path'], strrpos($file['path'], '/'));
            $filename = ltrim($filename, '/');
            $filename = str_replace('.php', '', $filename);

            if (in_array($filename, $excluded)) {
                continue;
            }

            $this->translations[$filename] = require $this->path . DIRECTORY_SEPARATOR . $file['path'];
        }

        $this->validateTranslations();

        return $this;
    }
public function read($locale, array $excluded = [])
    {
        // Empty our translations for a new read
        $this->translations = collect();

        $files = $this->filesystem->listContents($locale);

        foreach ($files as $file) {
            $filename = substr($file['path'], strrpos($file['path'], '/'));
            $filename = ltrim($filename, '/');
            $filename = str_replace('.php', '', $filename);

            if (in_array($filename, $excluded)) {
                continue;
            }

            $this->translations[$filename] = require $this->path . DIRECTORY_SEPARATOR . $file['path'];
        }

        $this->validateTranslations();

        return $this;
    }
public function read ( $ locale , array $ excluded = [ ] ) { // Empty our translations for a new read $ this -> translations = collect ( ) ; $ files = $ this -> filesystem -> listContents ( $ locale ) ; foreach ( $ files as $ file ) { $ filename = substr ( $ file [ 'path' ] , strrpos ( $ file [ 'path' ] , '/' ) ) ; $ filename = ltrim ( $ filename , '/' ) ; $ filename = str_replace ( '.php' , '' , $ filename ) ; if ( in_array ( $ filename , $ excluded ) ) { continue ; } $ this -> translations [ $ filename ] = require $ this -> path . DIRECTORY_SEPARATOR . $ file [ 'path' ] ; } $ this -> validateTranslations ( ) ; return $ this ; }
Read the lang files for a specific locale

@param $locale
@param array $excluded filenames that should be excluded from the read
@return \Illuminate\Support\Collection
Read the lang files for a specific locale