Changeset 1586
- Timestamp:
- 09/17/06 12:12:16 (2 years ago)
- Location:
- trunk/gregarius
- Files:
-
- 1 added
- 3 modified
-
admin/index.php (modified) (1 diff)
-
cls/l10n.php (modified) (3 diffs)
-
intl/pt_BR/LC_MESSAGES/messages.mo (added)
-
schema.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/gregarius/admin/index.php
r1577 r1586 263 263 ); 264 264 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)) { 266 266 $ret[$entry]=getLanguageInfo($entry); 267 267 } -
trunk/gregarius/cls/l10n.php
r1584 r1586 38 38 function RSSl10n() { 39 39 $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)) { 45 42 $locales=array( 46 $m[0].' UTF-8',47 $m[0].' utf-8',43 $m[0].'.UTF-8', 44 $m[0].'.utf-8', 48 45 $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] 52 49 ); 53 50 setlocale(LC_ALL, $locales); … … 81 78 */ 82 79 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'])) { 84 81 setcookie(RSS_LOCALE_COOKIE,$_REQUEST['lang'],time()+3600*6,getPath()); 85 82 return $_REQUEST['lang']; … … 103 100 // xx-yy -> xx_YY 104 101 $ret= $pm[1] ."_".strtoupper($pm[2]); 105 } elseif(file_exists(GREGARIUS_HOME .'intl/'.$pm[1] ."_".strtoupper($pm[1]))) {106 // xx-yy -> xx_XX107 $ret= $pm[1] ."_".strtoupper($pm[1]);108 102 } 109 } elseif(file_exists(GREGARIUS_HOME .'intl/'.$pm[1] ."_".strtoupper($pm[1]))) {110 // xx -> xx _XX111 $ret= $pm[1] ."_".strtoupper($pm[1]);103 } elseif(file_exists(GREGARIUS_HOME .'intl/'.$pm[1] )) { 104 // xx -> xx 105 $ret= $pm[1]; 112 106 } elseif($pm[1] == 'en') { 113 107 // ugly: a better way would be to look up all the available locales -
trunk/gregarius/schema.php
r1581 r1586 447 447 "rss.output.usepermalinks" => array("true","true","boolean","Display a permalink icon and allow linking a given item directly.",NULL), 448 448 "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), 450 450 "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), 451 451 "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),
