Show
Ignore:
Timestamp:
09/10/06 14:15:59 (2 years ago)
Author:
mbonetti
Message:

Fulltext language support

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/gregarius/admin/index.php

    r1569 r1571  
    258258    $ret = array(); 
    259259    $activeIdx = "0"; 
    260     $ret['en_US']='en_US'; 
     260    $ret['en_US']=array( 
     261        'language'=>'English', 
     262        'windows-locale'=>'english' 
     263    ); 
    261264    while (false !== ($entry = $d->read())) { 
    262265        if (preg_match('#^[a-z]{2}_[A-Z]{2}$#',$entry)) { 
    263             $ret[$entry]=$entry; 
     266            $ret[$entry]=getLanguageInfo($entry); 
    264267        }  
    265268    } 
     
    270273 
    271274 
    272 function getLanguageInfo($file) { 
     275function getLanguageInfo($dir) { 
    273276    $info = array(); 
    274     $path = "../intl/$file"; 
     277    $path = "../intl/$dir/langinfo.txt"; 
    275278    if (file_exists($path)) { 
    276279        $f = @fopen($path,'r'); 
     
    283286        } 
    284287 
    285         if ($contents && preg_match_all("/\/\/\/\s?([^:]+):(.*)/",$contents,$matches,PREG_SET_ORDER)) { 
     288        if ($contents && preg_match_all("/([^:]+):(.*)/",$contents,$matches,PREG_SET_ORDER)) { 
    286289            foreach($matches as $match) { 
    287290                $key = trim(strtolower($match[1])); 
    288291                $val = trim($match[2]); 
    289                 if ($key == 'version') { 
    290                     $val=preg_replace('/[^0-9\.]+/','',$val); 
    291                 } 
    292  
    293292                $info[$key] = $val; 
    294293            }