Project

General

Profile

Actions

Bug #102178

open

Html lang field wrong

Added by Juraj Sulek about 1 year ago. Updated 17 days ago.

Status:
Under Review
Priority:
Should have
Assignee:
-
Category:
SEO
Target version:
-
Start date:
2023-10-16
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
12
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

the property hreflang was removed from config.yaml in the site configuration.
Now in the vendor/typo3/cms-frontend/Classes/Http/RequestHandler.php this code is used:

$htmlTagAttributes[$docType->isXmlCompliant() ? 'xml:lang' : 'lang'] = $siteLanguage->getLocale()->getLanguageCode();

which produces <html lang="en" for the locale: en_GB.UTF-8
should it not be

$htmlTagAttributes[$docType->isXmlCompliant() ? 'xml:lang' : 'lang'] = $siteLanguage->getLocale()->getName();

in order to get <html lang="en-GB"
because the 'hyphens: auto;' behavior differs for <html lang="en" and for <html lang="en-GB"

When set to 'en', the string 'vegan' is split as 'veg-an', while for 'en-GB', it is correctly split as 've-gan'.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Task #101160: Keep hreflang property in site configurationClosedBenni Mack2023-06-23

Actions
Actions

Also available in: Atom PDF