blessing-skin-server/app/Services/Translations/Loader.php
2019-09-07 23:20:16 +08:00

20 lines
477 B
PHP

<?php
namespace App\Services\Translations;
use Spatie\TranslationLoader\TranslationLoaderManager;
class Loader extends TranslationLoaderManager
{
protected function loadPath($path, $locale, $group)
{
$translations = parent::loadPath($path, $locale, $group);
$full = "{$path}/{$locale}/{$group}.yml";
return count($translations) === 0 && $this->files->exists($full)
? resolve(Yaml::class)->parse($full)
: [];
}
}