Changeset 12995

Show
Ignore:
Timestamp:
12/06/11 23:34:29 (1 year ago)
Author:
p_lindheimer
Message:

closes #5463 adds modgettext class and replaces all the repeated loops throughout the code with the use of this static class

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/branches/2.10/amp_conf/htdocs/admin/config.php

    r12976 r12995  
    196196if(!$quietmode && is_array($active_modules)){ 
    197197  foreach($active_modules as $key => $module) { 
    198  
     198    modgettext::push_textdomain($module['rawname']); 
    199199    if (isset($module['items']) && is_array($module['items'])) { 
    200200      foreach($module['items'] as $itemKey => $itemName) { 
     
    211211      $configpageinits[] = $initfuncname; 
    212212    } 
     213    modgettext::pop_textdomain(); 
    213214  } 
    214215} 
     
    303304    } else if (file_exists($module_file)) { 
    304305      // load language info if available 
    305       if (extension_loaded('gettext')) { 
    306         if (is_dir("modules/{$module_name}/i18n")) { 
    307           bindtextdomain($module_name,"modules/{$module_name}/i18n"); 
    308           bind_textdomain_codeset($module_name, 'utf8'); 
    309           textdomain($module_name); 
    310         } 
    311       } 
     306      modgettext::textdomain($module_name); 
    312307      include($module_file); 
    313308    } else { 
  • freepbx/branches/2.10/amp_conf/htdocs/admin/functions.inc.php

    r12957 r12995  
    103103   */ 
    104104  if ($class === true) { 
    105     $class = array('ampuser','CI_Email','CI_Table','CssMin','component','featurecode','cronmanager','moduleHook','modulelist','notifications','xml2Array'); 
     105    $class = array('ampuser','CI_Email','CI_Table','CssMin','component','featurecode','cronmanager','moduleHook','modulelist','notifications','xml2Array','modgettext'); 
    106106  } else { 
    107107    $class = array($class); 
     
    159159    case 'modulelist': 
    160160      require_once($dirname . '/libraries/modulelist.class.php'); 
     161      break; 
     162    case 'modgettext': 
     163      require_once($dirname . '/libraries/modgettext.class.php'); 
    161164      break; 
    162165    case 'notifications': 
  • freepbx/branches/2.10/amp_conf/htdocs/admin/helpers/freepbx_helpers.php

    r12296 r12995  
    9494  $html.='<option value="" style="background-color:white;">'.$nodest_msg.'</option>'; 
    9595  foreach($drawselects_module_hash as $mod => $disc){ 
    96     /* We bind to the hosting module's domain. If we find the translation there we use it, if not 
    97      * we try the default 'amp' domain. If still no luck, we will try the _() which is the current 
    98      * module's display since some old translation code may have stored it locally but should migrate */ 
    99     bindtextdomain($drawselects_module_hash[$mod],"modules/".$drawselects_module_hash[$mod]."/i18n"); 
    100     bind_textdomain_codeset($drawselects_module_hash[$mod], 'utf8'); 
    101     $label_text=dgettext($drawselects_module_hash[$mod],$mod); 
    102     if($label_text==$mod){$label_text=dgettext('amp',$label_text);} 
    103     if($label_text==$mod){$label_text=_($label_text);} 
     96 
     97    $label_text = modgettext::_($mod, $drawselects_module_hash[$mod]); 
     98 
    10499    /* end i18n */ 
    105100    $selected=($mod==$destmod)?' SELECTED ':' '; 
  • freepbx/branches/2.10/amp_conf/htdocs/admin/libraries/components.class.php

    r12536 r12995  
    438438          $modparts = explode("_",$func,2); 
    439439          $thismod = $modparts[0]; 
    440           if (isset($_COOKIE['lang']) && is_dir("./modules/$thismod/i18n/".$_COOKIE['lang'])) { 
    441             bindtextdomain($thismod,"./modules/$thismod/i18n"); 
    442             bind_textdomain_codeset($thismod, 'utf8'); 
    443             textdomain($thismod); 
    444        
    445             $func($this->_compname); 
    446  
    447             textdomain('amp'); 
    448           } else { 
    449             $func($this->_compname); 
    450           } 
     440 
     441          modgettext::push_textdomain($thismod); 
     442          $func($this->_compname); 
     443          modgettext::pop_textdomain(); 
    451444        } 
    452445      } 
  • freepbx/branches/2.10/amp_conf/htdocs/admin/libraries/moduleHook.class.php

    r12198 r12995  
    2727    } 
    2828    foreach($our_hooks as $thismod => $funct) { 
    29       if (isset($_COOKIE['lang']) && is_dir("./modules/$thismod/i18n/".$_COOKIE['lang'])) { 
    30         bindtextdomain($thismod,"./modules/$thismod/i18n"); 
    31         bind_textdomain_codeset($thismod, 'utf8'); 
    32         textdomain($thismod); 
    33         if ($hookReturn = $funct($target_menuid, $viewing_itemid)) { 
    34           $this->hookHtml .= $hookReturn; 
    35         } 
    36         textdomain('amp'); 
    37       } else { 
    38         if ($hookReturn = $funct($target_menuid, $viewing_itemid)) { 
    39           $this->hookHtml .= $hookReturn; 
    40         } 
     29      modgettext::push_textdomain($thismod); 
     30      if ($hookReturn = $funct($target_menuid, $viewing_itemid)) { 
     31        $this->hookHtml .= $hookReturn; 
    4132      } 
     33      modgettext::pop_textdomain(); 
    4234    } 
    4335  }  
  • freepbx/branches/2.10/amp_conf/htdocs/admin/libraries/usage_registry.functions.php

    r12390 r12995  
    3030    $function = $mod."_check_extensions"; 
    3131    if (function_exists($function)) { 
    32       $prev_domain = textdomain(NULL); 
    33       if (isset($_COOKIE['lang']) && is_dir("./modules/$mod/i18n/".$_COOKIE['lang'])) { 
    34         bindtextdomain($mod,"./modules/$mod/i18n"); 
    35         bind_textdomain_codeset($mod, 'utf8'); 
    36         textdomain($mod); 
    37         $module_usage = $function($exten); 
    38       } else { 
    39         textdomain('amp'); 
    40         $module_usage = $function($exten); 
    41       } 
     32      modgettext::push_textdomain($mod); 
     33      $module_usage = $function($exten); 
    4234      if (!empty($module_usage)) { 
    4335        $exten_usage[$mod] = $module_usage; 
    4436      } 
    45       textdomain($prev_domain); 
     37      modgettext::pop_textdomain(); 
    4638    } 
    4739  } 
     
    9385    $function = $mod."_check_destinations"; 
    9486    if (function_exists($function)) { 
    95       $prev_domain = textdomain(NULL); 
    96       if (isset($_COOKIE['lang']) && is_dir("./modules/$mod/i18n/".$_COOKIE['lang'])) { 
    97         bindtextdomain($mod,"./modules/$mod/i18n"); 
    98         bind_textdomain_codeset($mod, 'utf8'); 
    99         textdomain($mod); 
    100         $module_usage = $function($dest); 
    101       } else { 
    102         textdomain('amp'); 
    103         $module_usage = $function($dest); 
    104       } 
     87      modgettext::push_textdomain($mod); 
     88      $module_usage = $function($dest); 
    10589      if (!empty($module_usage)) { 
    10690        $dest_usage[$mod] = $module_usage; 
    10791      } 
    108       textdomain($prev_domain); 
     92      modgettext::pop_textdomain(); 
    10993    } 
    11094  } 
     
    254238        $function = $mod."_getdestinfo"; 
    255239        if (function_exists($function)) { 
    256           $prev_domain = textdomain(NULL); 
    257           if (isset($_COOKIE['lang']) && is_dir("./modules/$mod/i18n/".$_COOKIE['lang'])) { 
    258             bindtextdomain($mod,"./modules/$mod/i18n"); 
    259             bind_textdomain_codeset($mod, 'utf8'); 
    260             textdomain($mod); 
    261             $check_module = $function($target); 
    262           } else { 
    263             textdomain('amp'); 
    264             $check_module = $function($target); 
    265           } 
    266           textdomain($prev_domain); 
     240          modgettext::push_textdomain($mod); 
     241          $check_module = $function($target); 
     242          modgettext::pop_textdomain(); 
    267243          if ($check_module !== false) { 
    268244            $found_owner = true; 
  • freepbx/branches/2.10/amp_conf/htdocs/admin/page.modules.php

    r12987 r12995  
    1616 
    1717global $active_repos; 
     18$loc_domain = 'amp'; 
    1819if (isset($_REQUEST['check_online'])) { 
    1920  $online = 1; 
     
    601602      } 
    602603 
    603       // This will load any module's i18n translations that are available and try to use them when printing the 
    604       // module names with a fall back to using the amp.po master translations for a check if not available in 
    605       // the local module. For new modules of course, there will be no translations usually. 
    606       // 
    607       if (extension_loaded('gettext') && is_dir("modules/".$name."/i18n")) { 
    608         bindtextdomain($name,"modules/".$name."/i18n"); 
    609         bind_textdomain_codeset($name, 'utf8'); 
    610         $loc_domain = $name; 
    611  
    612         $name_text = dgettext($loc_domain,$modules[$name]['name']); 
    613         if ($name_text == $modules[$name]['name']) { 
    614           $name_text = _($name_text); 
    615         } 
    616       } else { 
    617         $name_text = _($modules[$name]['name']); 
    618         $loc_domain = false; 
    619       } 
     604      $loc_domain = $name; 
     605      $name_text = modgettext::_($modules[$name]['name'], $loc_domain); 
    620606 
    621607      echo "\t\t<li id=\"module_".prep_id($name)."\">\n"; 
     
    691677      if (isset($modules_online[$name]['attention']) && !empty($modules_online[$name]['attention'])) { 
    692678        echo "\t\t\t\t<div class=\"tabbertab\" title=\""._("Attention")."\">\n"; 
    693         echo nl2br( $loc_domain ? dgettext($loc_domain,$modules[$name]['attention']) : _($modules[$name]['attention']) ); 
     679        echo nl2br(modgettext::_($modules[$name]['attention']), $loc_domain); 
    694680        echo "\t\t\t\t</div>\n"; 
    695681      } 
     
    785771      if (isset($modules[$name]['description']) && !empty($modules[$name]['description'])) { 
    786772        echo "<h5>".sprintf(_("Description for version %s"),$modules[$name]['version'])."</h5>"; 
    787         echo nl2br( $loc_domain ? dgettext($loc_domain,$modules[$name]['description']) : _($modules[$name]['description']) ); 
     773        echo nl2br(modgettext::_($modules[$name]['description']), $loc_domain); 
    788774      } else { 
    789775        echo _("No description is available."); 
  • freepbx/branches/2.10/amp_conf/htdocs/admin/views/menu.php

    r12978 r12995  
    7575  $count = 0; 
    7676  foreach($menu as $t => $cat) { //catagories 
    77     //TODO: this is broken, not getting translation from modules 
    78     //      see old code from freepbx_admin as to how to get it, requires a lot of hoops 
    79     //      first checking in the module owner's i18n, then in the core i18n 
    80     // 
    8177    if (count($cat) == 1) { 
    8278      if (isset($cat[0]['hidden']) && $cat[0]['hidden'] == 'true') { 
     
    8682      $target = isset($cat[0]['target']) ? ' target="' . $cat[0]['target'] . '"'  : ''; 
    8783      $class = $cat[0]['display'] == $display ? 'class="ui-state-highlight"' : ''; 
    88       $mods[$t] = '<a href="' . $href . '" ' . $target . $class . '>' . _(ucwords($t)) . '</a>'; 
     84      $mods[$t] = '<a href="' . $href . '" ' . $target . $class . '>' . modgettext::_(ucwords($t),$cat[0]['module']['rawname']) . '</a>'; 
    8985      continue; 
    9086    } 
     87    // $t is a heading so can't be isolated to a module, translation must come from amp 
    9188    $mods[$t] = '<a href="#" class="module_menu_button">' 
    9289        . _(ucwords($t)) 
     
    118115      } 
    119116 
     117      // try the module's translation domain first 
    120118      $items[$mod['name']] = '<li><a href="' . $href . '"' 
    121119          . $target 
    122120          . 'class="' . implode(' ', $classes) . '">' 
    123           . _(ucwords($mod['name'])
     121          . modgettext::_(ucwords($mod['name']), $mod['module']['rawname']
    124122          . '</a></li>'; 
    125123 
  • modules/branches/2.10/core/page.advancedsettings.php

    r12852 r12995  
    8383      $row++; 
    8484    } 
    85     if ($c['module'] && extension_loaded('gettext') && is_dir("modules/".$c['module']."/i18n")) { 
    86       bindtextdomain($c['module'],"modules/".$c['module']."/i18n"); 
    87       bind_textdomain_codeset($c['module'], 'utf8'); 
    88       $current_category_loc = dgettext($c['module'],$current_category); 
    89       if ($current_category_loc == $current_category) { 
    90           $current_cateogry_loc = _($current_category); 
    91       } 
    92     } else { 
    93       $current_category_loc = _($current_category); 
    94     } 
     85    $current_category_loc = modgettext::_($current_category, $c['module']); 
    9586    echo '<tr><td colspan="3"><br><h4 class="category">'._("$current_category_loc").'</h4></td></tr>'; 
    9687    $row++; 
     
    9990  $name_label_raw = $c['name']; 
    10091  $description_raw = $c['description']; 
    101   if ($c['module'] && extension_loaded('gettext') && is_dir("modules/".$c['module']."/i18n")) { 
    102     bindtextdomain($c['module'],"modules/".$c['module']."/i18n"); 
    103     bind_textdomain_codeset($c['module'], 'utf8'); 
    104     $name_label = dgettext($c['module'],$name_label_raw); 
    105     $tt_description = dgettext($c['module'],$description_raw); 
    106     if ($name_label == $name_label_raw) { 
    107       $name_label = _($name_label_raw); 
    108     } 
    109     if ($tt_description == $description_raw) { 
    110       $tt_description = _($description_raw); 
    111     } 
    112   } else { 
    113     $name_label = _($name_label_raw); 
    114     $tt_description = _($description_raw); 
    115   } 
     92  $name_label = modgettext::_($name_label_raw, $c['module']); 
     93  $tt_description = modgettext::_($description_raw, $c['module']); 
    11694  if (!$display_friendly_name) { 
    11795    $tr_friendly_name = $name_label; 
  • modules/branches/2.10/core/page.ampusers.php

    r12852 r12995  
    237237          echo "<option value=\"".$key."\""; 
    238238          if (in_array($key, $sections)) echo " SELECTED"; 
    239           $label = dgettext($row['rawname'],$row['name']); 
    240           if ($label == $row['name']) { 
    241             $label = _($label); 
    242           } 
     239          $label = modgettext::_($row['name'],$row['rawname']); 
    243240          echo ">"._($row['name'])."</option>\n"; 
    244241        } 
  • modules/branches/2.10/directory/functions.inc.php

    r12275 r12995  
    494494  // Add the 'process' function - this gets called when the page is loaded, to hook into  
    495495  // displaying stuff on the page. 
    496   $currentcomponent->addoptlistitem('directory_group', '0', dgettext('directory',_("Exclude"))); 
    497   $currentcomponent->addoptlistitem('directory_group', '1', dgettext('directory',_("Include"))); 
     496  $currentcomponent->addoptlistitem('directory_group', '0', _("Exclude")); 
     497  $currentcomponent->addoptlistitem('directory_group', '1', _("Include")); 
    498498  $currentcomponent->setoptlistopts('directory_group', 'sort', false); 
    499499 
  • modules/branches/2.10/extensionsettings/page.extensionsettings.php

    r12653 r12995  
    5656  } 
    5757  if ($txtdom == 'core') { 
    58     $txtdom = 'amp'; 
    5958    $active_modules[$key]['name'] = 'Extensions'; 
    60     $core_heading = $sub_heading =  dgettext($txtdom,$active_modules[$key]['name']); 
     59    $core_heading = $sub_heading =  modgettext::_($active_modules[$key]['name'], $txtdom); 
    6160  } else { 
    62     $sub_heading =  dgettext($txtdom,$active_modules[$key]['name']); 
     61    $sub_heading =  modgettext::_($active_modules[$key]['name'], $txtdom); 
    6362  } 
    6463  $module_select[$sub_heading_id] = $sub_heading; 
  • modules/branches/2.10/featurecodeadmin/functions.inc.php

    r10747 r12995  
    111111        $modulename = $result['modulename']; 
    112112 
    113         // normally gettext is done by drawselects, but in this case we are getting strings from other modules as well 
    114         // where the translations are. We will therefore try to do the translation here. Then drawselects will try to 
    115         // translate against the already translated strings but should just fail and default to what we pass back 
    116         // 
    117         if (!isset($text_domain['modulename']) & $modulename != 'core') { 
    118           if (extension_loaded('gettext') && is_dir("modules/".$modulename."/i18n")) { 
    119             bindtextdomain($modulename,"modules/$modulename/i18n"); 
    120             bind_textdomain_codeset($modulename, 'utf8'); 
    121             $text_domain[$modulename] = true; 
    122           } else { 
    123             $text_domain[$modulename] = false; 
    124           } 
    125         } 
    126         if ($modulename != 'core' && $text_domain[$modulename]) { 
    127           $description = dgettext($modulename,$result['featuredescription']); 
    128           if ($description == $result['featuredescription']) { 
    129             $description = dgettext('amp',$description); 
    130           } 
    131         } else { 
    132           $description = dgettext('amp',$result['featuredescription']); 
    133         } 
     113        $description = modgettext::_($result['featuredescription'], $modulename); 
     114        // Just in case the translation was not found in either the module or amp, we will try to see 
     115        // if they put it in the featurecode module i18n 
    134116        if ($description == $result['featuredescription']) { 
    135117            $description = _($description); 
    136118        } 
     119 
    137120        $thisexten = ($result['customcode'] != '')?$result['customcode']:$result['defaultcode']; 
    138121        $extens[] = array('destination' => 'ext-featurecodes,'.$result['defaultcode'].',1', 'description' => $description.' <'.$thisexten.'>'); 
  • modules/branches/2.10/featurecodeadmin/page.featurecodeadmin.php

    r12445 r12995  
    9191  foreach($featurecodes as $item) { 
    9292 
    93     $bind_domains = array(); 
    94     if ($item['modulename'] == 'core' ) textdomain('amp'); 
    95     if (isset($bind_domains[$item['modulename']]) || (extension_loaded('gettext') && is_dir("modules/".$item['modulename']."/i18n"))) { 
    96       if (!isset($bind_domains[$item['modulename']])) { 
    97         $bind_domains[$item['modulename']] = true; 
    98         bindtextdomain($item['modulename'],"modules/".$item['modulename']."/i18n"); 
    99         bind_textdomain_codeset($item['modulename'], 'utf8'); 
    100       } 
    101  
    102       $moduledesc = isset($item['moduledescription'])?dgettext($item['modulename'],$item['moduledescription']):null; 
    103       if (($moduledesc !== null) && ($moduledesc == $item['moduledescription'])) { 
    104         $moduledesc = _($moduledesc); 
    105       } 
    106       $featuredesc = dgettext($item['modulename'],$item['featuredescription']); 
    107       if ($featuredesc == $item['featuredescription']) { 
    108         $featuredesc = _($featuredesc); 
    109       } 
    110     } else { 
    111       $moduledesc = isset($item['moduledescription'])?_($item['moduledescription']):null; 
    112       $featuredesc = _($item['featuredescription']); 
     93    $moduledesc = isset($item['moduledescription']) ? modgettext::_($item['moduledescription'], $item['modulename']) : null; 
     94    // just in case the translator put the translation in featurcodes module: 
     95    if (($moduledesc !== null) && ($moduledesc == $item['moduledescription'])) { 
     96      $moduledesc = _($moduledesc); 
     97    } 
     98 
     99    $featuredesc = modgettext::_($item['featuredescription'], $item['modulename']); 
     100    // just in case the translator put the translation in featurcodes module: 
     101    if ($featuredesc == $item['featuredescription']) { 
     102      $featuredesc = _($featuredesc); 
    113103    } 
    114104 
  • modules/branches/2.10/printextensions/page.printextensions.php

    r12304 r12995  
    120120  } 
    121121  if ($key == 'did') { 
    122     $txtdom = 'amp'; 
    123122    $active_modules[$key]['name'] = 'Inbound Routes'; 
    124     $core_heading = $sub_heading =  dgettext($txtdom, $active_modules[$key]['name']); 
     123    $core_heading = $sub_heading =  modgettext::_($active_modules[$key]['name'], $txtdom); 
    125124  } elseif ($txtdom == 'core') { 
    126     $txtdom = 'amp'; 
    127125    $active_modules[$key]['name'] = 'Extensions'; 
    128     $core_heading = $sub_heading =  dgettext($txtdom, $active_modules[$key]['name']); 
     126    $core_heading = $sub_heading =  modgettext::_($active_modules[$key]['name'], $txtdom); 
    129127  } else { 
    130     $sub_heading =  dgettext($txtdom, $active_modules[$key]['name']); 
    131   } 
     128    $sub_heading =  modgettext::_($active_modules[$key]['name'], $txtdom); 
     129  } 
     130 
    132131  $module_select[$sub_heading_id] = $sub_heading; 
    133132  $textext = _("Extension"); 
     
    174173if ((!$quietmode || isset($_REQUEST[$sub_heading_id])) && isset($full_list['featurecodeadmin'])) { 
    175174  $featurecodes = featurecodes_getAllFeaturesDetailed(false); 
    176   $sub_heading =  dgettext($txtdom,$active_modules['featurecodeadmin']['name']); 
     175  $sub_heading =  modgettext::_($active_modules['featurecodeadmin']['name'], $txtdom); 
    177176  $module_select[$sub_heading_id] = $sub_heading; 
    178177  $html_txt_arr[$sub_heading] =  "<div class=\"$sub_heading_id\"><table border=\"0\" width=\"75%\"><tr colspan=\"2\" width='100%'><td><br /><strong>".sprintf("%s",$sub_heading)."</strong></td></tr>\n"; 
    179178  foreach ($featurecodes as $item) { 
    180     $bind_domains = array(); 
    181     if (isset($bind_domains[$item['modulename']])  
    182       || (extension_loaded('gettext') &&  is_dir("modules/".$item['modulename']."/i18n"))) { 
    183       if (!isset($bind_domains[$item['modulename']])) { 
    184         $bind_domains[$item['modulename']] = true; 
    185         bindtextdomain($item['modulename'],"modules/".$item['modulename']."/i18n"); 
    186         bind_textdomain_codeset($item['modulename'], 'utf8'); 
    187       } 
    188     } 
    189179    $moduleena = ($item['moduleenabled'] == 1 ? true : false); 
    190180    $featureena = ($item['featureenabled'] == 1 ? true : false); 
     
    200190 
    201191    $txtdom = $item['modulename']; 
    202     // if core then get translations from amp 
    203     if ($txtdom == 'core') { 
    204       $txtdom = 'amp'; 
    205     } 
    206     textdomain($txtdom); 
     192    modgettext::textdomain($txtdom); 
    207193    if ($featureena && $moduleena) { 
    208       $label_desc = sprintf(dgettext($txtdom,$item['featuredescription'])); 
     194      $label_desc = sprintf(modgettext::_($item['featuredescription'],$txtdom)); 
    209195      if (!$quietmode) { 
    210196        $thiscode = "<a href='config.php?type=setup&display=featurecodeadmin'>$thiscode</a>"; 
     
    239225        $rnav_txt .= "<li><input type=\"checkbox\" value=\"$id\" name=\"$id\" id=\"$id\" class=\"disp_filter\" CHECKED /><label id=\"lab_$id\" name=\"lab_$id\" for=\"$id\">$sub</label></li>\n"; 
    240226      } 
    241       $rnav_txt .= "</ul><hr><div style=\"text-align:center\"><input type=\"submit\" value=\"".sprintf(dgettext('printextensions',_("Printer Friendly Page")))."\" /></div>\n"; 
     227      $rnav_txt .= "</ul><hr><div style=\"text-align:center\"><input type=\"submit\" value=\"".sprintf(modgettext::_("Printer Friendly Page", $dispnum))."\" /></div>\n"; 
    242228      echo $rnav_txt; 
    243229      ?> 
  • modules/branches/2.10/recordings/functions.inc.php

    r10736 r12995  
    409409    $function = $mod."_recordings_usage"; 
    410410    if (function_exists($function)) { 
    411       if (isset($_COOKIE['lang']) && is_dir("./modules/$mod/i18n/".$_COOKIE['lang'])) { 
    412         $prev_domain = textdomain(NULL); 
    413         bindtextdomain($mod,"./modules/$mod/i18n"); 
    414         bind_textdomain_codeset($mod, 'utf8'); 
    415         textdomain($mod); 
    416         $recordings_usage = $function($id); 
    417         textdomain($prev_domain); 
    418       } else { 
    419         $recordings_usage = $function($id); 
    420       } 
     411      modgettext::push_textdomain($mod); 
     412      $recordings_usage = $function($id); 
     413      modgettext::pop_textdomain(); 
    421414      if (!empty($recordings_usage)) { 
    422415        $full_usage_arr = array_merge($full_usage_arr, $recordings_usage); 
  • modules/branches/2.10/vmblast/functions.inc.php

    r11537 r12995  
    263263  // Add the 'process' function - this gets called when the page is loaded, to hook into  
    264264  // displaying stuff on the page. 
    265   $currentcomponent->addoptlistitem('vmblast_group', '0', dgettext('vmblast',_("Exclude"))); 
    266   $currentcomponent->addoptlistitem('vmblast_group', '1', dgettext('vmblast',_("Include"))); 
     265  $currentcomponent->addoptlistitem('vmblast_group', '0', _("Exclude")); 
     266  $currentcomponent->addoptlistitem('vmblast_group', '1', _("Include")); 
    267267  $currentcomponent->setoptlistopts('vmblast_group', 'sort', false); 
    268268