Changeset 1584 for trunk/gregarius/cls

Show
Ignore:
Timestamp:
09/16/06 10:57:41 (2 years ago)
Author:
mbonetti
Message:

fix for #442

Location:
trunk/gregarius/cls
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/gregarius/cls/l10n.php

    r1583 r1584  
    3434    var $cache; 
    3535    var $locale; 
     36    var $isolang; 
    3637     
    3738    function RSSl10n() { 
    3839        $this -> locale = preg_replace('#[^a-zA-Z_]#','',$this -> __detectUserLang()); 
     40         
     41        $ll=explode('_',$this -> locale); 
     42        $this->isloang=$ll[0].'-'.strtoupper($ll[1]); 
     43         
    3944        if (function_exists('version_compare') && version_compare("4.3.0",PHP_VERSION, "<=") && preg_match('#([a-z]{2})_([A-Z]{2})#',$this -> locale,$m)) { 
    4045            $locales=array( 
     
    6873    function getLocale() { 
    6974        return $this -> locale; 
     75    } 
     76    function getISOLang() { 
     77        return $this ->isloang; 
    7078    } 
    7179    /** 
     
    102110                        // xx  -> xx_XX 
    103111                        $ret= $pm[1] ."_".strtoupper($pm[1]); 
     112                    } elseif($pm[1] == 'en') { 
     113                        // ugly: a better way would be to look up all the available locales 
     114                        // and match against that list 
     115                        $ret='en_US'; 
    104116                    } 
    105117                    if ($ret) { 
  • trunk/gregarius/cls/wrappers/header.php

    r1561 r1584  
    157157} 
    158158 
     159function rss_header_doclang() { 
     160    return isset($GLOBALS['rssl10n']) && $GLOBALS['rssl10n']->getISOLang() ? $GLOBALS['rssl10n']->getISOLang():'en'; 
     161} 
    159162?>