Adding 'lang' attribute to language links in template.php I am not a Drupal developer, but still I would like to know how to make the links in a language switcher HTML5 valid. It seems these links lack an attribute 'lang' (with as value the abbrevation of the language). How would I do that in template.php?
I found the solution:

function MYTHEME_links__locale_block(&amp;$vars) {

  foreach($vars['links'] as $language =&gt; $langInfo) {
    $name = $langInfo['language']-&gt;native;
    $lang = $langInfo['language']-&gt;language;
    $vars['links'][$language]['title'] = $name;
    $vars['links'][$language]['attributes']['xml:lang'] = $lang;
    $vars['links'][$language]['attributes']['lang'] = $lang;
    $vars['links'][$language]['html'] = TRUE;
  }
  $content = theme_links($vars);
 return $content;
}