FYI: Language Attribute Variant Fix
-
Topic: ISO-compliant HTML Language Attributes and Formal Language Packs
To anyone using either:
- WP 4.3.x
- OR WP 4.4.x
AND one of the “formal” language variants such as
- German (Formal) / Deutsch (Sie)
- Swiss German (Formal)
- Dutch (Formal)
There is an unfixed bug in WordPress versions 4.3.x and 4.4.x, which in combination with any of the above “formal” language variants leads to an invalid HTML language attribute in your HTML markup, such as
<html lang="de-DE-formal">
instead of<html lang="de-DE">
.Since this is not ISO compliant, applications (browsers and especially screen-readers) will not know what language is actually being used. This in turn may lead to unexpected and unpleasant consequences for your visitors.
This has been fixed in WordPress 4.5
by adding the stringhtml_lang_attribute
to all WordPress language files, which is then being used to populate the HTML language attribute.However, since there are those who cannot install WordPress 4.5 yet (in which case you might want to have a look at WP Downgrade), I asked Bernhard Kau if he could think of a solution to this. Within an hour (!) he came up with Language Attribute Variant Fix, which truncates the language attribute to make it ISO-compliant.
I packaged the new plugin as language-attribute-variant-fix.zip, so that it can be easily uploaded and installed manually.
- The topic ‘FYI: Language Attribute Variant Fix’ is closed to new replies.