The HTML5 template introduced in #1077566: Convert html.tpl.php to HTML5 uses xml:lang in the template, even though the HTML 5 spec has this to say about that:
From http://www.whatwg.org/specs/web-apps/current-work/#the-lang-and-xml:lang...
The lang attribute (in no namespace) specifies the primary language for the element's contents and for any of the element's attributes that contain text. Its value must be a valid BCP 47 language tag, or the empty string. Setting the attribute to the empty string indicates that the primary language is unknown. [BCP47]
The lang attribute in the XML namespace is defined in XML. [XML]
If these attributes are omitted from an element, then the language of this element is the same as the language of its parent element, if any.
The lang attribute in no namespace may be used on any HTML element.
The lang attribute in the XML namespace may be used on HTML elements in XML documents, as well as elements in other namespaces if the relevant specifications allow it (in particular, MathML and SVG allow lang attributes in the XML namespace to be specified on their elements). If both the lang attribute in no namespace and the lang attribute in the XML namespace are specified on the same element, they must have exactly the same value when compared in an ASCII case-insensitive manner.
Authors must not use the lang attribute in the XML namespace on HTML elements in HTML documents. To ease migration to and from XHTML, authors may specify an attribute in no namespace with no prefix and with the literal localname "xml:lang" on HTML elements in HTML documents, but such attributes must only be specified if a lang attribute in no namespace is also specified, and both attributes must have the same value when compared in an ASCII case-insensitive manner.
The attribute in no namespace with no prefix and with the literal localname "xml:lang" has no effect on language processing.
Comment | File | Size | Author |
---|---|---|---|
#4 | 1330922_4_xml_lang.patch | 3.56 KB | scor |
#3 | 1330922.patch | 1.35 KB | ericduran |
Comments
Comment #1
Gábor HojtsyAlso xml:lang is referenced in rdf.module, book module, openid, search, various maintenance templates (which were not yet converted to HTML 5?). At least those things that build data for regular page output like rdf, book, search should use lang AFAIS.
Comment #2
ericduran CreditAttribution: ericduran commentedYep, xml-lang needs be replaced with lang.
Comment #3
ericduran CreditAttribution: ericduran commentedLets see what breaks where.
Comment #4
scor CreditAttribution: scor commentedconverted rdf and search modules to @lang. I haven't included the module which output their doctype themselves, as it might have some impact which should be considered in their respective issues: book, openid, and maintenance-page.tpl.php for system, bartik and seven.
Comment #5
Gábor HojtsyWow, that was quick :) Conceptually I think this looks pretty good, waiting for the testbot. I agree modules using their own page markup should be looked at separately, not only for xml:lang probably also for HTML 5 conversion IMHO.
Comment #6
ericduran CreditAttribution: ericduran commented@Gábor Hojtsy Ha, the html5 crew isn't kidding around :)
Comment #7
Gábor HojtsyOk, I grepped around, and this fixes all that are not inside custom page templates (openid, book export and maintenance pages in themes). Do we have an issue for converting those to HTML5? Since those do not belong here, I consider this complete and ready to go.
Comment #8
JacineYes, they're being worked on now. :)
#1189834: Convert book-export-html.tpl.php to HTML5
#1189822: Convert maintenance-page.html.twig to HTML5
Comment #9
catchMakes sense. Committed/pushed to 8.x.
Comment #10
Gábor HojtsyNode language lang and dir attributes at #1164926: Nodes need to have languages specified separately for accessibility.
Comment #12
Gábor HojtsyTagging for base language system.