private function getLocaleFromTypo3(Request $request): ?string
    {
        $locale = null;

        if ((bool) $language = $request->attributes->get('language')) {
            /* @var SiteLanguage $language */
            [$locale] = \explode('.', $language->getLocale());
        } elseif ((bool) $site = $request->attributes->get('site')) {
            /* @var Site $site */
            [$locale] = \explode('.', $site->getDefaultLanguage()->getLocale());
        }

        return $locale;
    }
private function getLocaleFromTypo3(Request $request): ?string
    {
        $locale = null;

        if ((bool) $language = $request->attributes->get('language')) {
            /* @var SiteLanguage $language */
            [$locale] = \explode('.', $language->getLocale());
        } elseif ((bool) $site = $request->attributes->get('site')) {
            /* @var Site $site */
            [$locale] = \explode('.', $site->getDefaultLanguage()->getLocale());
        }

        return $locale;
    }
private function getLocaleFromTypo3 ( Request $ request ) : ? string { $ locale = null ; if ( ( bool ) $ language = $ request -> attributes -> get ( 'language' ) ) { /* @var SiteLanguage $language */ [ $ locale ] = \ explode ( '.' , $ language -> getLocale ( ) ) ; } elseif ( ( bool ) $ site = $ request -> attributes -> get ( 'site' ) ) { /* @var Site $site */ [ $ locale ] = \ explode ( '.' , $ site -> getDefaultLanguage ( ) -> getLocale ( ) ) ; } return $ locale ; }
Tries to get the exact locale from TYPO3 if it can be found in the request.
Tries to get the exact locale from TYPO3 if it can be found in the request .