Show
Ignore:
Timestamp:
09/10/06 12:09:42 (2 years ago)
Author:
mbonetti
Message:

multiple locale is supported in php 4.3.0+

Files:
1 modified

Legend:

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

    r1569 r1570  
    3333    var $l10n; 
    3434    var $cache; 
     35    var $locale; 
    3536     
    3637    function RSSl10n($locale) { 
    3738        $locale = preg_replace('#[^a-zA-Z_]#','',$locale); 
    38         if (function_exists('version_compare') && version_compare("4.2.0",PHP_VERSION, "<=") && preg_match('#([a-z]{2})_([A-Z]{2})#',$locale,$m)) { 
     39        $this -> locale = $locale; 
     40        if (function_exists('version_compare') && version_compare("4.3.0",PHP_VERSION, "<=") && preg_match('#([a-z]{2})_([A-Z]{2})#',$locale,$m)) { 
    3941            $locales=array( 
    4042                $m[0].'UTF-8', 
     
    4951            setlocale(LC_ALL, $locale); 
    5052        } 
    51          
     53     
    5254        $path = GREGARIUS_HOME .'/intl/' . $locale . '/LC_MESSAGES/messages.mo'; 
    5355        $streamer = new FileReader($path); 
     
    6365        $this -> cache[$msg] = $ret; 
    6466        return $ret; 
    65          
    6667    } 
    6768}