diff --git a/core/includes/language.inc b/core/includes/language.inc index a243d2e..2b7352b 100644 --- a/core/includes/language.inc +++ b/core/includes/language.inc @@ -306,6 +306,7 @@ function language_negotiation_method_enabled($method_id, $type = NULL) { function language_negotiation_get_switch_links($type, $path) { $links = FALSE; $negotiation = variable_get("language_negotiation_$type", array()); + $language = language_types_initialize($type); foreach ($negotiation as $method_id => $method) { if (isset($method['callbacks']['language_switch'])) { @@ -316,6 +317,12 @@ function language_negotiation_get_switch_links($type, $path) { $callback = $method['callbacks']['language_switch']; $result = $callback($type, $path); + // Add support for WCAG 2.0's Language of Parts to add language identifiers. + // http://www.w3.org/TR/UNDERSTANDING-WCAG20/meaning-other-lang-id.html + foreach ($result as $langcode => $link) { + $result[$langcode]['attributes']['lang'] = $langcode; + } + if (!empty($result)) { // Allow modules to provide translations for specific links. drupal_alter('language_switch_links', $result, $type, $path);