Skip to content

Magento sets iso invalid language code in html header #11540

Closed
@v0gler

Description

@v0gler

Preconditions

  1. Using Magento 2.1.8

Steps to reproduce

  1. Using magento with german language

Expected result

  1. Html header of page should be <html lang="de">

Actual result

  1. Html header is <html lang="de-DE">

This comes from the code in the constructor of framework/View/Page/Config.php
$this->setElementAttribute( self::ELEMENT_TYPE_HTML, self::HTML_ATTRIBUTE_LANG, str_replace('_', '-', $this->localeResolver->getLocale()) );

"de-DE" is no valid iso language code. (https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes)
If you are using word-breaks with hyphenation in css like:

word-break: break-word; hyphens: auto;
You get the result that the hyphens aren't correctly set or no hyphens are set based on the wrong language code. With correct language code, in this case "de", hyphenation is working as expected with german language.

Metadata

Metadata

Assignees

Labels

Fixed in 2.1.xThe issue has been fixed in 2.1 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.1.xThe issue has been reproduced on latest 2.1 releaseReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 release

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions