Hi,
in this site (http://provolini.mine.nu) I am using a theme that uses icons for the node links (like add comment, read more, etc.) but these icons disappear when I choose a language that is not English from locale settings in my profile section.

The problem seems to be the $link array used in the node.tpl.php which (for example) does not include the class="icon-add-comment" attribute for the link Add new comment

//Output using English Localization:
<a class="icon-add-comment" href="/comment/reply/4#comment_form" title="Add a new comment to this page.">add new comment</a>

//Output using Italian Localization:
<a href="/comment/reply/8#comment_form" title="Aggiungi un nuovo commento a questa pagina.">aggiungi nuovo commento</a>

How can I get rid of this? Where is the problem?
Thank you for your help.

Comments

puleddu’s picture

I think this could help...

From template.php:

function golden_hour_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('Add a new comment to this page') => 'add-comment',
    t('Share your thoughts and opinions related to this posting') => 'add-comment',
    t('Jump to the first comment') => 'comment',
    t('Reply to this comment') => 'reply',
//     t('Read more') => 'read-more',
    t('Printer-friendly version') => 'print',
    t('add child page') => 'add-child-page',
    t('calendar') => 'calendar',
  );

  $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);
        break;
      }
    }
    $new_links[] = $link;
  }

  return implode($delimiter, $new_links);
}

but... I can not found a solution.

puleddu’s picture

I added a '.' in the

t('Add a new comment to this page') => 'add-comment',

statement! A simple "period!" to make the string like this (note the '.' after the word "page")

t('Add a new comment to this page.') => 'add-comment',

what a strange issue!
Do I have to point this to the theme author?

---
Antonio
http://taldeitali.it

jwolf’s picture

That is very strange. Thanks for finding this.
This inspires me to complete all my sentences with a period
.