Changeset 1569
- Timestamp:
- 09/10/06 11:52:49 (2 years ago)
- Location:
- trunk/gregarius
- Files:
-
- 4 modified
-
admin/config.php (modified) (1 diff)
-
admin/index.php (modified) (1 diff)
-
cls/l10n.php (modified) (1 diff)
-
init.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/gregarius/admin/config.php
r1561 r1569 298 298 case 'rss.output.lang': 299 299 $langs = getLanguages(); 300 300 301 $codes = array_keys($langs); 301 302 $out_val = implode(',',$codes); -
trunk/gregarius/admin/index.php
r1561 r1569 258 258 $ret = array(); 259 259 $activeIdx = "0"; 260 $ret['en_US']='en_US'; 260 261 while (false !== ($entry = $d->read())) { 261 if ( 262 $entry != "CVS" && 263 substr($entry,0,1) != "." 264 ) { 265 $info = getLanguageInfo($entry); 266 if (count($info) && array_key_exists('language',$info)) { 267 $shortL= preg_replace('|\.php.*$|','',$entry); 268 $ret[$shortL] = $info['language']; 269 } 270 } 262 if (preg_match('#^[a-z]{2}_[A-Z]{2}$#',$entry)) { 263 $ret[$entry]=$entry; 264 } 271 265 } 272 266 $d->close(); -
trunk/gregarius/cls/l10n.php
r1479 r1569 35 35 36 36 function RSSl10n($locale) { 37 $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 $locales=array( 40 $m[0].'UTF-8', 41 $m[0].'utf-8', 42 $m[0], 43 $m[1].'_'.strtoupper($m[1]), 44 $m[1], 45 $m[2] 46 ); 47 setlocale(LC_ALL, $locales); 48 } else { 49 setlocale(LC_ALL, $locale); 50 } 51 37 52 $path = GREGARIUS_HOME .'/intl/' . $locale . '/LC_MESSAGES/messages.mo'; 38 53 $streamer = new FileReader($path); -
trunk/gregarius/init.php
r1564 r1569 115 115 // Localization 116 116 // 117 require_once('cls/l10n.php');118 $GLOBALS['rssl10n'] = new RSSl10n();119 120 121 117 $lang = getConfig('rss.output.lang'); 122 118 if (!preg_match('#^[a-zA-Z_]+$#', $lang)) { 123 119 die('woopsie, bad lang: ' .$lang); 124 120 } 121 122 require_once('cls/l10n.php'); 123 $GLOBALS['rssl10n'] = new RSSl10n($lang); 124 125 125 126 126 127 if ($lang && file_exists(dirname(__FILE__) . "/" . "intl/$lang.php")) { … … 146 147 } 147 148 148 149 /* 149 150 // Load the right locale 150 151 if (defined('OVERRIDE_LOCALE')) { … … 166 167 } 167 168 } 168 169 */ 169 170 170 171
