Changeset 1571 for trunk/gregarius/admin/index.php
- Timestamp:
- 09/10/06 14:15:59 (2 years ago)
- Files:
-
- 1 modified
-
trunk/gregarius/admin/index.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/gregarius/admin/index.php
r1569 r1571 258 258 $ret = array(); 259 259 $activeIdx = "0"; 260 $ret['en_US']='en_US'; 260 $ret['en_US']=array( 261 'language'=>'English', 262 'windows-locale'=>'english' 263 ); 261 264 while (false !== ($entry = $d->read())) { 262 265 if (preg_match('#^[a-z]{2}_[A-Z]{2}$#',$entry)) { 263 $ret[$entry]= $entry;266 $ret[$entry]=getLanguageInfo($entry); 264 267 } 265 268 } … … 270 273 271 274 272 function getLanguageInfo($ file) {275 function getLanguageInfo($dir) { 273 276 $info = array(); 274 $path = "../intl/$ file";277 $path = "../intl/$dir/langinfo.txt"; 275 278 if (file_exists($path)) { 276 279 $f = @fopen($path,'r'); … … 283 286 } 284 287 285 if ($contents && preg_match_all("/ \/\/\/\s?([^:]+):(.*)/",$contents,$matches,PREG_SET_ORDER)) {288 if ($contents && preg_match_all("/([^:]+):(.*)/",$contents,$matches,PREG_SET_ORDER)) { 286 289 foreach($matches as $match) { 287 290 $key = trim(strtolower($match[1])); 288 291 $val = trim($match[2]); 289 if ($key == 'version') {290 $val=preg_replace('/[^0-9\.]+/','',$val);291 }292 293 292 $info[$key] = $val; 294 293 }
