I'm using OpenIdeaL with i18n in a multilingual website. For the most part, it all works out pretty well. The issue I'm having is with the ideal_main.module. In default language (English) the Idea count is properly displayed in the Ideas in Action tab (in the Ideas page). But when I switch to French, the tab titles are properly translated but the count disappears.

How can I change this function so that counter are shown for all languages?

/**
 * Implements hook_quicktabs_alter()
 * Add counter to quicktab title.
 */
function ideal_main_quicktabs_alter(&$quicktabs) { 
  $quicktabs_to_alter = array("all_ideas", "ideas_by_category", "in_action");
  if (in_array($quicktabs->machine_name, $quicktabs_to_alter)) {
    foreach ($quicktabs->tabs as $key => $tab){
      
      // find what quicktab instance we're in, and what block this is
      $block = substr($tab['bid'], strpos($tab['bid'], "block"));
      $view = substr($tab['bid'], 0, strpos($tab['bid'], "block")-1);
      $view = substr($view, strpos($view, "delta")+6);
     
      // if this is one of the tabs we want to add the counter to
      if ($view == "ideas_in_action" || ($block == "block_5" && ($view == "ideas_by_category" || $view == "ideas_all"))) {
        $count = ideal_main_quicktabs_view_counter($view, $block);
        $quicktabs->tabs[$key]['title'] .= " (" . $count . ")";
      }
    }
  }
}
CommentFileSizeAuthor
#2 no quicktab count in French.jpg39.85 KBbisonbleu
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bisonbleu’s picture

Issue summary: View changes

Formatting for php

bisonbleu’s picture

Here's what I mean. Note the absence of (count) in the French UI. Doing a demo in Vegas Thursday; would be nice if...

Quicktabs no count

bisonbleu’s picture

Category: Support request » Bug report

Setting to Bug report. Hoping to resolve this issue before Christmas *<//:{)}}}