I have a node with two languages defined. if i logged in as user and display the node i can see the language switching flags under the node content. This one adds to mich "pipes". As you can see here, there are two pipes next together. This is wrong and caused by i18n module. Additonal the pipe is not such high, as the flags are. see the attachment, please.

<div class="links"><a href="/drupal/index.php?q=en/node/13"><img src="/drupal/modules/i18n/flags/en.png" class="i18n-icon" width="16" height="12" alt="English" /></a> | | 246 Abrufe</div>

CommentFileSizeAuthor
#1 Drupal_i18n_Bug2.png477 bytesmarc.bau
Drupal_i18n_Bug1.png732 bytesmarc.bau

Comments

marc.bau’s picture

StatusFileSize
new477 bytes

additional, if a user is not logged in there is a pipe diplayed after the last flag, and nothing else, see the second screenshot, please.

jose reyero’s picture

Priority: Normal » Minor

If you see the html, the two pipes are outside i18n links so I think they are placed there by some other module.
Please try disabling other modules...

marc.bau’s picture

hm... it's some weeks ago, but i have found it in i18n code... but i cannot remember the line. i have no other modules active adding something to the links. i only see the page hits counter, comment link and i18n...

davemybes’s picture

The line you're looking for is in the theme_i18n_link function i believe. However, I also don't think that its caused by i18n. The pipe characters are actually inserted by theme_links function in theme.inc (in the includes folder). I use i18n on several sites and have never seen that double pipe. What I have seen before is an extra one after all the links. If you theme the links function, you will have much control on how the links look, and you might be able to see where those extra pipes come from. To theme it, you need the following functions in template.php (I am including an extra function to theme the i18n links too, just in case):

/** 
 * Override $links output
 * NOTE: change function name to match theme name eg. change THEMENAME_links to chameleon_links if using the chameleon theme
 **/
 
function THEMENAME_links($links, $delimiter = ' ') {
  if (!is_array($links)) {
    return '';
  }

  /* Maps a link to it's associated class */
  $link_to_id = array(
    t('edit') => 'edit',
    t('delete') => 'delete',
    t('reply') => 'reply',
    t('add new comment') => 'add-comment',
    t('Jump to the first comment') => 'comment',
    t('read more') => 'read-more',
    t('printer-friendly version') => 'print',
    t('add child page') => 'add-child-page',
    t('calendar') => 'calendar',
    t('add child category') => 'add-child-cat',
    t('add child container') => 'add-child-cont',
   // if you have other modules that create $links then add the text to this list
   // to get specific classes added to them too.
  );

  $new_links = array();
  
  foreach ($links as $link) {
    foreach ($link_to_id as $text => $id) {
      if (strpos($link, $text)) {
        $link = str_replace('<a ', "<a class=\"icon-$id\" ", $link);
        $link = str_replace('</a>', "</a><span class=\"delimiter $id\"> &#0183; </span>", $link);
      }
    }
    $new_links[] = $link;
  }
 // code to identify the last link and remove its delimiter
  $linkscount = count($new_links);
  $linkscount = $linkscount-1;
  $lastlink = end($new_links);
  $lastlink = str_replace('&#0183;','',$lastlink);
  $new_links[$linkscount] = $lastlink;
 // end  
  return implode($delimiter, $new_links);
}
 
/**
 * Catch the theme_i18n_link function so that we can customize output of i18n icons and text
 */

function THEMENAME_i18n_link($text, $target, $lang, $separator='&nbsp;'){
  $output = '<span class="i18n-link">';
  $attributes = ($lang == i18n_get_lang()) ? array('class' => 'active') : NULL;
  $output .= l(theme('i18n_language_icon', $lang), $target, $attributes, NULL, NULL, FALSE, TRUE);
  $output .= $separator;
  $output .= '<span class="i18n-linktext">'; // added this...
  $output .= l($text, $target, $attributes, NULL, NULL, FALSE, TRUE);
  $output .= '</span>';                      // ... and this
  $output .= '</span>';
  return $output;
}

Hope this helps you.

jose reyero’s picture

Status: Active » Closed (won't fix)

I can't find this issue in i18n module nor I've been able to reproduce it.

If someone can provide more details, feel free to reopen this bug.