Commit c7c2af24 authored by catch's avatar catch
Browse files

Issue #1330922 by ericduran, scor: Fixed Drupal 8 HTML 5 page template should...

Issue #1330922 by ericduran, scor: Fixed Drupal 8 HTML 5 page template should use lang not xml:lang.
parent 56d12d5e
......@@ -2364,8 +2364,7 @@ function template_preprocess_html(&$variables) {
$variables['body_attributes_array'] = array();
// HTML element attributes.
$variables['html_attributes_array']['xmlns'] = "http://www.w3.org/1999/xhtml";
$variables['html_attributes_array']['xml:lang'] = $GLOBALS['language']->language;
$variables['html_attributes_array']['lang'] = $GLOBALS['language']->language;
$variables['html_attributes_array']['dir'] = $GLOBALS['language']->direction ? 'rtl' : 'ltr';
// Add favicon.
......
......@@ -624,13 +624,13 @@ function rdf_preprocess_user_profile(&$variables) {
* Implements MODULE_preprocess_HOOK().
*/
function rdf_preprocess_username(&$variables) {
// Because xml:lang is set on the HTML element that wraps the page, the
// Because lang is set on the HTML element that wraps the page, the
// username inherits this language attribute. However, since the username
// might not be transliterated to the same language that the content is in,
// we do not want it to inherit the language attribute, so we set the
// attribute to an empty string.
if (empty($variables['attributes_array']['xml:lang'])) {
$variables['attributes_array']['xml:lang'] = '';
if (empty($variables['attributes_array']['lang'])) {
$variables['attributes_array']['lang'] = '';
}
// $variables['account'] is a pseudo account object, and as such, does not
......
......@@ -384,10 +384,10 @@ class RdfMappingDefinitionTestCase extends TaxonomyWebTestCase {
$this->drupalGet('node/' . $node->nid);
// Ensures the default bundle mapping for user is used on the Authored By
// information on the node.
$author_about = $this->xpath('//a[@typeof="sioc:UserAccount" and @about=:account-uri and @property="foaf:name" and contains(@xml:lang, "")]', array(
$author_about = $this->xpath('//a[@typeof="sioc:UserAccount" and @about=:account-uri and @property="foaf:name" and contains(@lang, "")]', array(
':account-uri' => $account_uri,
));
$this->assertTrue(!empty($author_about), t('RDFa markup found on author information on post. xml:lang on username is set to empty string.'));
$this->assertTrue(!empty($author_about), t('RDFa markup found on author information on post. The lang attribute on username is set to empty string.'));
}
/**
......
......@@ -110,8 +110,8 @@ function template_preprocess_search_result(&$variables) {
$variables['url'] = check_url($result['link']);
$variables['title'] = check_plain($result['title']);
if (isset($result['language']) && $result['language'] != $language->language && $result['language'] != LANGUAGE_NONE) {
$variables['title_attributes_array']['xml:lang'] = $result['language'];
$variables['content_attributes_array']['xml:lang'] = $result['language'];
$variables['title_attributes_array']['lang'] = $result['language'];
$variables['content_attributes_array']['lang'] = $result['language'];
}
$info = array();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment