Changeset 6582

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

re #2461 this change will do the gettext from the module's domain, if they have a domain and the string is not translated, then it would not otherwise translate it, so it checks if the translation is the same as the original string and if so, it attempts using _() which will check featurecodes and amp domains (which otherwise happens if there is no domain for the target language defined)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.5/featurecodeadmin/page.featurecodeadmin.php

    r6581 r6582  
    8282        foreach($featurecodes as $item) { 
    8383 
    84                 // change domains to get the translations from each module 
    85                 // 
    86  
    87                 if (extension_loaded('gettext') && is_dir("modules/".$item['modulename']."/i18n")) { 
    88                         $text_domain = $item['modulename']; 
    89                         bindtextdomain($text_domain,"modules/".$text_domain."/i18n"); 
    90                         bind_textdomain_codeset($text_domain, 'utf8'); 
    91  
    92                         $moduledesc = isset($item['moduledescription'])?dgettext($text_domain,$item['moduledescription']):null; 
    93                         $featuredesc = dgettext($text_domain,$item['featuredescription']); 
     84                $bind_domains = array(); 
     85                if (isset($bind_domains[$item['modulename']]) || (extension_loaded('gettext') && is_dir("modules/".$item['modulename']."/i18n"))) { 
     86                        if (!isset($bind_domains[$item['modulename']])) { 
     87                                $bind_domains[$item['modulename']] = true; 
     88                                bindtextdomain($item['modulename'],"modules/".$item['modulename']."/i18n"); 
     89                                bind_textdomain_codeset($item['modulename'], 'utf8'); 
     90                        } 
     91 
     92                        $moduledesc = isset($item['moduledescription'])?dgettext($item['modulename'],$item['moduledescription']):null; 
     93                        if (($moduledesc !== null) && ($moduledesc == $item['moduledescription'])) { 
     94                                $moduledesc = _($moduledesc); 
     95                        } 
     96                        $featuredesc = dgettext($item['modulename'],$item['featuredescription']); 
     97                        if ($featuredesc == $item['featuredescription']) { 
     98                                $featuredesc = _($featuredesc); 
     99                        } 
    94100                } else { 
    95101                        $moduledesc = isset($item['moduledescription'])?_($item['moduledescription']):null; 
Donate



Support
Download
Develop
Forums
News
Documentation
Paid Support
About

Paid Ads