Changeset 6581

Show
Ignore:
Timestamp:
09/06/08 13:19:11 (3 months ago)
Author:
p_lindheimer
Message:

re #2461 these changes make it appear to finally work. If the translation files for a featurecode are in the module that provides the feature codes, it seems to pickup the translations there, if it does not find them there, then it appears to pickup the translatino from featurecodeadmin and if not there, it seems to pick them up form the amp.po file, making it capable of using tranlations's that have been put in all the different places in the past but in the future, allows them to be housed with the hosting module

Files:

Legend:

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

    r6580 r6581  
    8484                // change domains to get the translations from each module 
    8585                // 
    86                 bindtextdomain($item['modulename'],"modules/".$item['modulename']."/i18n"); 
    87                 $moduledesc = isset($item['moduledescription'])?gettext($item['moduledescription']):null; 
    88                 $featuredesc = gettext($item['featuredescription']); 
    89                 bindtextdomain($dispnum,"modules/".$dispnum."/i18n"); 
     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']); 
     94                } else { 
     95                        $moduledesc = isset($item['moduledescription'])?_($item['moduledescription']):null; 
     96                        $featuredesc = _($item['featuredescription']); 
     97                } 
    9098 
    9199                $moduleena = ($item['moduleenabled'] == 1 ? true : false); 
Donate



Support
Download
Develop
Forums
News
Documentation
Paid Support
About

Paid Ads