TDoG-Skin/app/Services/Translations/Loader.php
2024-08-17 19:13:54 +08:00

20 lines
477 B
PHP
Executable File

<?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)
: [];
}
}