Changeset 6884

Show
Ignore:
Timestamp:
09/29/08 11:30:32 (2 months ago)
Author:
p_lindheimer
Message:

fixes #3248 change translation domain to each destination's hosting module, and if nothing found, try amp and then the current module

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/branches/2.5/amp_conf/htdocs/admin/functions.inc.php

    r6864 r6884  
    19231923         
    19241924        $all_destinations = array(); 
     1925        $module_hash = array(); 
    19251926 
    19261927        $selectHtml = '<tr><td colspan=2>';  
     
    19371938                                        $cat = (isset($dest['category']) ? $dest['category'] : $module['displayname']); 
    19381939                                        $all_destinations[$cat][] = $dest; 
     1940                                        $module_hash[$cat] = $rawmod; 
    19391941                                } 
    19401942                        } 
    19411943                } 
    19421944        } 
    1943 //      var_dump($all_destinations); 
    1944 //      var_dump($goto); 
    19451945 
    19461946        $foundone = false; 
     
    19611961                // conflicting with each other 
    19621962                $radioid = uniqid("drawselect"); 
     1963 
     1964                $cat_identifier = preg_replace('/[^a-zA-Z0-9]/','_', $cat); 
     1965 
     1966                // We bind to the hosting module's domain. If we find the translation there we use it, if not 
     1967                // we try the default 'amp' domain. If still no luck, we will try the _() which is the current 
     1968                // module's display since some old translation code may have stored it localy but should migrate 
    19631969                // 
    1964                 $cat_identifier = preg_replace('/[^a-zA-Z0-9]/','_', $cat); 
     1970                bindtextdomain($module_hash[$cat],"modules/".$module_hash[$cat]."/i18n"); 
     1971                bind_textdomain_codeset($module_hash[$cat], 'utf8'); 
     1972                $label_text = dgettext($module_hash[$cat],$cat); 
     1973                if ($label_text == $cat) { 
     1974                        $label_text = dgettext('amp',$label_text); 
     1975                } 
     1976                if ($label_text == $cat) { 
     1977                        $label_text = _($label_text); 
     1978                } 
    19651979                         
    19661980                if ($tabindex_needed && ($checked || ! $goto)) { 
     
    19741988                                //'onkeypress="javascript:if (event.keyCode == 0 || (document.all && event.keyCode == 13)) this.form.goto'.$i.'.value=\''.$cat.'\';" '. 
    19751989                                ($checked? 'CHECKED=CHECKED' : '').' /> '; 
    1976                 $selectHtml .= '<label for="'.$radioid.'">'._($cat).':</label> '; 
     1990                $selectHtml .= '<label for="'.$radioid.'">'.$label_text.':</label> '; 
    19771991                 
    19781992                // set the  
Donate



Support
Download
Develop
Forums
News
Documentation
Paid Support
About

Paid Ads