How to hide language switcher block if node has no translation? Having a bilingual site here. Some nodes are translated and language switcher works fine. But the switcher block also shows up on nodes which aren't translated. Then the untranslated language link has a different styling.

How can I hide the switcher when there's no (other) translation of the node? I looked up variables in all preprocess functions without finding any indicators. What do I have to look for? And how then can I hide the switcher?
In template.php add:

/**
 * hide language switcher if en-gb is not set
 */
function MYTHEME_links__locale_block(&amp;$vars) {
  // made conditional if other languages are added later
  if(!isset($vars['links']['en-gb']['href'])) {
    unset($vars['links']['en-gb']);
  }
  // here is the condition
  if(count($vars['links']) &lt;= 1) {
    return '';
  } else {
    return theme_links($vars);
  }
}