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;
    }