Changeset 6583

Show
Ignore:
Timestamp:
09/06/08 17:34:17 (3 months ago)
Author:
p_lindheimer
Message:

closes #3166 includes compatibility mode. translation using module's i18n is done first. If the translated text is the same as the original text, then translation is done against the the default _() which is amp.po at that point. So for previous translation work, it will continue to pull the old translations. All modules should move towards providing their own translations for menu items as this point despite this.

Files:

Legend:

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

    r5760 r6583  
    1313        $sort_name = Array(); 
    1414        $sort_type = Array(); 
     15        $framework_text_domain = Array(); 
    1516        // Sorting menu by category and name 
    1617        foreach ($fpbx_menu as $key => $row) { 
     
    1920                $sort_name[$key] = $row['name']; 
    2021                $sort_type[$key] = $row['type']; 
     22 
     23                if (extension_loaded('gettext') && is_dir("modules/".$key."/i18n")) { 
     24                        bindtextdomain($key,"modules/".$framework_text_domain."/i18n"); 
     25                        bind_textdomain_codeset($key, 'utf8'); 
     26                        $framework_text_domain[$key] = true; 
     27                } else { 
     28                        $framework_text_domain[$key] = false; 
     29                } 
    2130        } 
    2231         
     
    95104 
    96105                echo "\t<li class=\"".implode(' ',$li_classes)."\">"; 
     106                if ($framework_text_domain[$key]) { 
     107                        $label_text = dgettext($key,$row['name']); 
     108                        if ($label_text == $row['name']) { 
     109                                $label_text = _($label_text); 
     110                        } 
     111                } else { 
     112                        $label_text = _($row['name']); 
     113                } 
    97114                if (isset($row['disabled']) && $row['disabled']) { 
    98                         echo _($row['name'])
     115                        echo $label_text
    99116                } else { 
    100                         echo '<a href="'.$href.'" '.$extra_attributes.' >'._($row['name'])."</a>"; 
     117                        echo '<a href="'.$href.'" '.$extra_attributes.' >'. $label_text . "</a>"; 
    101118                } 
    102119                echo "</li>\n"; 
Donate



Support
Download
Develop
Forums
News
Documentation
Paid Support
About

Paid Ads