A backup language is what you should use. See docs
You can also configure a “fallback language” to be used when the active language does not contain a given language line. As the default language, the backup language is also configured in the app/config/app.phpconfiguration file:
'fallback_locale' => 'en',
, , , , , . , , .
, , - . - .
, . , . helpers.php app. composer.json autoload files "app/helpers.php". , ? . . composer dump-autoload.
trans_fb(), trans(), . , ( ).
Laravel ( resources/lang/en/auth.php, auth.failed ), .
<?php
if (! function_exists('trans_fb')) {
function trans_fb($id, $fallback, $parameters = [], $domain = 'messages', $locale = null)
{
return ($id === ($translation = trans($id, $parameters, $domain, $locale))) ? $fallback : $translation;
}
}
:
{{ trans_fb("i.love.laravel", "I love Laravel!") }}