Changeset 1571

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

Fulltext language support

Location:
trunk/gregarius
Files:
12 added
3 modified

Legend:

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

    r1569 r1571  
    106106    case 'rss.output.lang': 
    107107        $arr = getLanguages(); 
    108         echo $arr[getConfig('rss.output.lang')]; 
     108        if (isset($arr[getConfig('rss.output.lang')]['language'])) { 
     109            echo $arr[getConfig('rss.output.lang')]['language']; 
     110        } else { 
     111            echo getConfig('rss.output.lang'); 
     112        } 
    109113        break; 
    110114    case 'rss.config.tzoffset': 
     
    441445        $value = ""; 
    442446        $langs = getLanguages(); 
    443         foreach ($langs as $code => $name) { 
     447        foreach ($langs as $code => $info) { 
     448            if (isset($info['language'])) { 
     449                $l=$info['language']; 
     450            } else { 
     451                $l=$code; 
     452            } 
    444453            echo "<option value=\"$code\""; 
    445454            if ($code == $active_lang)   { 
    446455                echo " selected=\"selected\""; 
    447456            } 
    448             echo ">".$langs[$code]."</option>\n"; 
     457            echo ">$l</option>\n"; 
    449458        } 
    450459        echo "</select>\n"; 
  • 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            } 
  • trunk/gregarius/schema.php

    r1546 r1571  
    447447        "rss.output.usepermalinks"  =>      array("true","true","boolean","Display a permalink icon and allow linking a given item directly.",NULL), 
    448448        "rss.config.markreadonupdate"=> array("false","false","boolean","Mark all old unread feeds as read when updating if new unread feeds are found.",NULL), 
    449         "rss.output.lang"           =>      array("en,es,fr,dk,it,pt_BR,se,0","en,es,fr,dk,it,pt_BR,se,0","enum","Language pack to use.",NULL), 
     449        "rss.output.lang"           =>      array("en_US,cn_ZH,de_DE,dk_DK,es_ES,fr_FR,he_IL,it_IT,ja_JP,pt_BR,pt_PT,ru_RU,sv_SV,0","en_US,cn_ZH,de_DE,dk_DK,es_ES,fr_FR,he_IL,it_IT,ja_JP,pt_BR,pt_PT,ru_RU,sv_SV,0","enum","Language pack to use.",NULL), 
    450450        "rss.config.absoluteordering"=> array("true","true","boolean","Allow feeds and folders to be ordered by their order in the admin section. If this option is set to false, channels and folders will be organized alphabetically by their titles.",NULL), 
    451451        "rss.config.robotsmeta"     =>      array("noindex,follow","noindex,follow","string","How should spiders crawl us? (see http://www.robotstxt.org/wc/meta-user.html for more info).",NULL),