private function getDenormalizedLocaleFromTypo3(Request $request): ?string
    {
        if ((bool) $language = $request->attributes->get('language')) {
            /* @var SiteLanguage $language */
            return \trim($language->getBase()->getPath(), '/');
        }

        if ((bool) $site = $request->attributes->get('site')) {
            /* @var Site $site */
            return \trim($site->getDefaultLanguage()->getBase()->getPath(), '/');
        }

        return null;
    }