33 lines
864 B
PHP
33 lines
864 B
PHP
<?php
|
|
|
|
namespace App;
|
|
|
|
use Illuminate\Support\Facades\Log;
|
|
use Illuminate\Support\Str;
|
|
use Illuminate\Translation\Translator as BaseTranslator;
|
|
class Translator extends BaseTranslator
|
|
{
|
|
/**
|
|
* @param string $key
|
|
* @param array $replace
|
|
* @param null $locale
|
|
* @param bool $fallback
|
|
*
|
|
* @return array|null|string|void
|
|
*/
|
|
public function get($key, array $replace = [], $locale = null, $fallback = true)
|
|
{
|
|
$translation = parent::get($key, $replace, $locale, $fallback);
|
|
|
|
if ($translation === $key && !Str::startsWith($key, 'validation.')) {
|
|
Log::warning('Language item could not be found.', [
|
|
'language' => $locale ?? config('app.locale'),
|
|
'id' => $key,
|
|
'url' => config('app.url')
|
|
]);
|
|
}
|
|
|
|
return $translation;
|
|
}
|
|
}
|