Changeset 1586

Show
Ignore:
Timestamp:
09/17/06 12:12:16 (2 years ago)
Author:
mbonetti
Message:
 
Location:
trunk/gregarius
Files:
1 added
3 modified

Legend:

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

    r1577 r1586  
    263263    ); 
    264264    while (false !== ($entry = $d->read())) { 
    265         if (preg_match('#^[a-z]{2}_[A-Z]{2}$#',$entry)) { 
     265        if (preg_match('#^[a-z]{2}_?([A-Z]{2})?$#',$entry)) { 
    266266            $ret[$entry]=getLanguageInfo($entry); 
    267267        }  
  • trunk/gregarius/cls/l10n.php

    r1584 r1586  
    3838    function RSSl10n() { 
    3939        $this -> locale = preg_replace('#[^a-zA-Z_]#','',$this -> __detectUserLang()); 
    40          
    41         $ll=explode('_',$this -> locale); 
    42         $this->isloang=$ll[0].'-'.strtoupper($ll[1]); 
    43          
    44         if (function_exists('version_compare') && version_compare("4.3.0",PHP_VERSION, "<=") && preg_match('#([a-z]{2})_([A-Z]{2})#',$this -> locale,$m)) { 
     40        $this -> isolang=str_replace('_','-',$this -> locale); 
     41        if (function_exists('version_compare') && version_compare("4.3.0",PHP_VERSION, "<=") && preg_match('#([a-z]{2})_?([A-Z]{2})?#',$this -> locale,$m)) { 
    4542            $locales=array( 
    46                 $m[0].'UTF-8', 
    47                 $m[0].'utf-8', 
     43                $m[0].'.UTF-8', 
     44                $m[0].'.utf-8', 
    4845                $m[0], 
    49                 $m[1].'_'.strtoupper($m[1]), 
    50                 $m[1], 
    51                 $m[2] 
     46                $m[1],               
     47                $m[1].'_'.strtoupper($m[1]) 
     48                //$m[2] 
    5249            ); 
    5350            setlocale(LC_ALL, $locales);     
     
    8178     */ 
    8279    function __detectUserLang() { 
    83        if (isset($_REQUEST['lang']) && preg_match('#^[a-z]{2}_[A-Z]{2}$#',$_REQUEST['lang']) && file_exists(GREGARIUS_HOME .'intl/'.$_REQUEST['lang'])) { 
     80       if (isset($_REQUEST['lang']) && preg_match('#^[a-z]{2}_?([A-Z]{2})?$#',$_REQUEST['lang']) && file_exists(GREGARIUS_HOME .'intl/'.$_REQUEST['lang'])) { 
    8481            setcookie(RSS_LOCALE_COOKIE,$_REQUEST['lang'],time()+3600*6,getPath()); 
    8582            return  $_REQUEST['lang']; 
     
    103100                            // xx-yy -> xx_YY 
    104101                            $ret= $pm[1] ."_".strtoupper($pm[2]); 
    105                         } elseif(file_exists(GREGARIUS_HOME .'intl/'.$pm[1] ."_".strtoupper($pm[1]))) { 
    106                             // xx-yy -> xx_XX 
    107                             $ret= $pm[1] ."_".strtoupper($pm[1]); 
    108102                        } 
    109                     } elseif(file_exists(GREGARIUS_HOME .'intl/'.$pm[1] ."_".strtoupper($pm[1]))) { 
    110                         // xx  -> xx_XX 
    111                         $ret= $pm[1] ."_".strtoupper($pm[1]); 
     103                    } elseif(file_exists(GREGARIUS_HOME .'intl/'.$pm[1] )) { 
     104                        // xx  -> xx 
     105                        $ret= $pm[1]; 
    112106                    } elseif($pm[1] == 'en') { 
    113107                        // ugly: a better way would be to look up all the available locales 
  • trunk/gregarius/schema.php

    r1581 r1586  
    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_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), 
     449        "rss.output.lang"           =>      array("en_US,zh_CN,de,da,es,fr,he,it,ja,pt_BR,pt,ru,sv,0","en_US,zh_CN,de,da,es,fr,he,it,ja,pt_BR,pt,ru,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),