diff --git a/src/FileLoader.php b/src/FileLoader.php index d8959ad..94ad0c6 100644 --- a/src/FileLoader.php +++ b/src/FileLoader.php @@ -53,24 +53,22 @@ public function load($locale, $group, $namespace = null) return array_replace_recursive($defaults, parent::load($locale, $group, $namespace)); } - - /** + + /** * Fall back to base locale (i.e. de) if a countries specific locale (i.e. de-CH) is not available * * @param string $path * @param string $locale * @param string $group - * @return array|mixed + * + * @return array */ protected function loadPath($path, $locale, $group) { $result = parent::loadPath($path, $locale, $group); - if ($result == [] && strpos($locale, '-') !== false) { - list($baseLocale) = explode('-', $locale); - if ($this->files->exists($full = "{$path}/{$baseLocale}/{$group}.php")) { - return $this->files->getRequire($full); - } + if (empty($result) && str_contains($locale, '-')) { + return parent::loadPath($path, strstr($locale, '-', true), $group); } return $result;