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.

CommentFileSizeAuthor
#4 1330922_4_xml_lang.patch3.56 KBscor
#3 1330922.patch1.35 KBericduran
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Gábor Hojtsy’s picture

Also 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.

ericduran’s picture

Yep, xml-lang needs be replaced with lang.

ericduran’s picture

FileSize
1.35 KB

Lets see what breaks where.

scor’s picture

Status: Active » Needs review
FileSize
3.56 KB

converted 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.

Gábor Hojtsy’s picture

Wow, 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.

ericduran’s picture

@Gábor Hojtsy Ha, the html5 crew isn't kidding around :)

Gábor Hojtsy’s picture

Status: Needs review » Reviewed & tested by the community

Ok, 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.

Jacine’s picture

catch’s picture

Status: Reviewed & tested by the community » Fixed

Makes sense. Committed/pushed to 8.x.

Gábor Hojtsy’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Gábor Hojtsy’s picture

Issue tags: +language-base

Tagging for base language system.