diff --git a/composer.json b/composer.json index ea1079b..8ecea91 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "mockery/mockery": "0.9.*", "orchestra/testbench": "~3.1", "phpunit/phpunit": "~4.7", - "satooshi/php-coveralls": "dev-master@dev" + "php-coveralls/php-coveralls": "^2.0" }, "minimum-stability": "dev", "prefer-stable": true, diff --git a/src/Translation/DistributedFileLoader.php b/src/Translation/DistributedFileLoader.php index 59d3acf..1bd75b7 100644 --- a/src/Translation/DistributedFileLoader.php +++ b/src/Translation/DistributedFileLoader.php @@ -32,6 +32,10 @@ public function __construct(Filesystem $files, array $paths = []) */ protected function loadPath($path, $locale, $group) { + if (null !== $path) { + return parent::loadPath($path, $locale, $group); + } + $result = []; foreach ($this->paths as $path) { $result = array_merge($result, parent::loadPath($path, $locale, $group)); @@ -39,4 +43,26 @@ protected function loadPath($path, $locale, $group) return $result; } + + /** + * Load a locale from a given path. + * + * @param string $path + * @param string $locale + * @param string $group + * @return array + */ + protected function loadJsonPath($path, $locale) + { + if (null !== $path) { + return parent::loadJsonPath($path, $locale); + } + + $result = []; + foreach ($this->paths as $path) { + $result = array_merge($result, parent::loadJsonPath($path, $locale)); + } + + return $result; + } }