src/Carbon/Traits/Localization.php
public static function setFallbackLocale($locale)
    {
        $translator = static::getTranslator();

        if (method_exists($translator, 'setFallbackLocales')) {
            $translator->setFallbackLocales([$locale]);

            if ($translator instanceof Translator) {
                $preferredLocale = $translator->getLocale();
                $translator->setMessages($preferredLocale, array_replace_recursive(
                    $translator->getMessages()[$locale] ?? [],
                    Translator::get($locale)->getMessages()[$locale] ?? [],
                    $translator->getMessages($preferredLocale)
                ));
            }
        }
    }
public static function setFallbackLocale($locale)
    {
        $translator = static::getTranslator();

        if (method_exists($translator, 'setFallbackLocales')) {
            $translator->setFallbackLocales([$locale]);

            if ($translator instanceof Translator) {
                $preferredLocale = $translator->getLocale();
                $translator->setMessages($preferredLocale, array_replace_recursive(
                    $translator->getMessages()[$locale] ?? [],
                    Translator::get($locale)->getMessages()[$locale] ?? [],
                    $translator->getMessages($preferredLocale)
                ));
            }
        }
    }
public static function setFallbackLocale ( $ locale ) { $ translator = static :: getTranslator ( ) ; if ( method_exists ( $ translator , 'setFallbackLocales' ) ) { $ translator -> setFallbackLocales ( [ $ locale ] ) ; if ( $ translator instanceof Translator ) { $ preferredLocale = $ translator -> getLocale ( ) ; $ translator -> setMessages ( $ preferredLocale , array_replace_recursive ( $ translator -> getMessages ( ) [ $ locale ] ?? [ ] , Translator :: get ( $ locale ) -> getMessages ( ) [ $ locale ] ?? [ ] , $ translator -> getMessages ( $ preferredLocale ) ) ) ; } } }
Set the fallback locale.

@see https://symfony.com/doc/current/components/translation.html#fallback-locales

@param string $locale
Set the fallback locale .