/** * Load directories. * * @param string $dirPath * * @return \Arcanedev\LaravelLang\Entities\LocaleCollection */ private function loadDirectories($dirPath) { $locales = new LocaleCollection(); foreach ($this->filesystem->directories($dirPath) as $path) { $excluded = in_array($key = basename($path), $this->excludedFolders); if (!$excluded) { $locales->add(new Locale($key, $path, $this->loadLocaleFiles($path))); } } return $locales; }