I've got lots of languages on my site which results in the unfortunate behaviour you see in the attached file - in this case the Greek flag is on one line and the text on the next line.

"No problem!" I said. I changed to 'separator' => '&nbsp;' in line 18 of languageicons.module, which I would have thought should be patched for everyone. The weird thing is, it doesn't work. It creates the desired behaviour in the source code, i.e. <a ...><img .../>&nbsp;Greek</a>, however, the browser still breaks the line there - it doesn't obey my nbsp! (tried FF 12 and IE 8).

Does anyone know why that would be and how we could fix this?

CommentFileSizeAuthor
links.png3.85 KBfletchgqc

Comments

johnv’s picture

What happens if you add the following to your css?
white-space: nowrap;

Nico_Drup’s picture

Issue summary: View changes

I had "quite" the same issue.
It seems to be a consequence of the main css from the theme you're using : the Only local images are allowed. have some unwanted attributes for flag icons.

Try to add this line to your css :
a img.language-icon { display:inline-block; white-space: nowrap;}

That should do the trick...

darkdim’s picture

Hi!
I used this recipe http://drupal.stackexchange.com/questions/54281/different-sets-of-langua...

function MYTHEME_theme_registry_alter(&$theme_registry){
  if( isset($theme_registry['languageicons_place']) ){
    $theme_registry['languageicons_place']['function'] = 'MYTHEME_languageicons_place';
  }
}

function MYTHEME_languageicons_place($variables) {
  $text = $variables['text'];
  $icon = $variables['icon'];
  $separator = '';

  switch (variable_get('languageicons_placement', 'before')) {
    case 'after':
      return $text . $separator . $icon;
    case 'replace':
      return $icon;
    case 'before':
    default:
      return $icon . $separator . $text;
  }
}