示例#1
0
 /**
  * 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;
 }
示例#2
0
 /**
  * Check if the locale is supported.
  *
  * @param  string  $key
  *
  * @return bool
  */
 public function isSupported($key)
 {
     return $this->locales->has($key);
 }