diff --git a/core/includes/language.inc b/core/includes/language.inc
index a243d2e..77ca75f 100644
--- a/core/includes/language.inc
+++ b/core/includes/language.inc
@@ -307,6 +307,11 @@ function language_negotiation_get_switch_links($type, $path) {
   $links = FALSE;
   $negotiation = variable_get("language_negotiation_$type", array());
 
+  // Only get the languages if we have more than one.
+  if (count(language_list()) >= 2) {
+    $language = language_types_initialize($type);
+  }
+
   foreach ($negotiation as $method_id => $method) {
     if (isset($method['callbacks']['language_switch'])) {
       if (isset($method['file'])) {
@@ -316,6 +321,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);
