From: Lo?c C. <lo...@us...> - 2001-05-02 22:25:26
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/localization In directory usw-pr-cvs1:/tmp/cvs-serv30757/chat/localization Modified Files: tutorial.lib.php3 languages.lib.php3 admin.lib.php3 Log Message: Improved a bit languages detection function Index: tutorial.lib.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/localization/tutorial.lib.php3,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** tutorial.lib.php3 2001/04/20 17:03:39 1.5 --- tutorial.lib.php3 2001/05/02 22:25:23 1.6 *************** *** 53,57 **** // 2 for the 'HTTP_USER_AGENT' one if ( ($envType == 0 && strcasecmp($name, $str) == 0) ! || ($envType == 1 && eregi('^(' . $key . ')$', $str)) || ($envType == 2 && eregi('(\(|\[|;[[:space:]])(' . $key . ')(;|\]|\))', $str))) { --- 53,57 ---- // 2 for the 'HTTP_USER_AGENT' one if ( ($envType == 0 && strcasecmp($name, $str) == 0) ! || ($envType == 1 && eregi('^(' . $key . ')(;q=[0-9]\\.[0-9])?$', $str)) || ($envType == 2 && eregi('(\(|\[|;[[:space:]])(' . $key . ')(;|\]|\))', $str))) { *************** *** 117,122 **** else if (!empty($HTTP_ACCEPT_LANGUAGE)) { ! $accepted = explode(',', getenv('HTTP_ACCEPT_LANGUAGE')); ! pmcTutorialDetect($accepted[0], 1); } --- 117,127 ---- else if (!empty($HTTP_ACCEPT_LANGUAGE)) { ! $accepted = explode(',', $HTTP_ACCEPT_LANGUAGE); ! $acceptedCnt = count($accepted); ! reset($accepted); ! for ($i = 0; $i < $acceptedCnt && empty($lang); $i++) ! { ! pmcTutorialDetect($accepted[$i], 1); ! } } *************** *** 125,129 **** else if (!empty($HTTP_USER_AGENT)) { ! pmcTutorialDetect(getenv('HTTP_USER_AGENT'), 2); } --- 130,134 ---- else if (!empty($HTTP_USER_AGENT)) { ! pmcTutorialDetect($HTTP_USER_AGENT, 2); } Index: languages.lib.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/localization/languages.lib.php3,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** languages.lib.php3 2001/04/27 18:30:28 1.6 --- languages.lib.php3 2001/05/02 22:25:23 1.7 *************** *** 53,57 **** // 2 for the 'HTTP_USER_AGENT' one if ( ($envType == 0 && strcasecmp($name, $str) == 0) ! || ($envType == 1 && eregi('^(' . $key . ')$', $str)) || ($envType == 2 && eregi('(\(|\[|;[[:space:]])(' . $key . ')(;|\]|\))', $str))) { --- 53,57 ---- // 2 for the 'HTTP_USER_AGENT' one if ( ($envType == 0 && strcasecmp($name, $str) == 0) ! || ($envType == 1 && eregi('^(' . $key . ')(;q=[0-9]\\.[0-9])?$', $str)) || ($envType == 2 && eregi('(\(|\[|;[[:space:]])(' . $key . ')(;|\]|\))', $str))) { *************** *** 128,133 **** else if (!empty($HTTP_ACCEPT_LANGUAGE)) { ! $accepted = explode(',', $HTTP_ACCEPT_LANGUAGE); ! pmcLangDetect($accepted[0], 1); } --- 128,138 ---- else if (!empty($HTTP_ACCEPT_LANGUAGE)) { ! $accepted = explode(',', $HTTP_ACCEPT_LANGUAGE); ! $acceptedCnt = count($accepted); ! reset($accepted); ! for ($i = 0; $i < $acceptedCnt && empty($dbSessionVars['lang']); $i++) ! { ! pmcLangDetect($accepted[$i], 1); ! } } Index: admin.lib.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/localization/admin.lib.php3,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** admin.lib.php3 2001/04/20 17:03:39 1.5 --- admin.lib.php3 2001/05/02 22:25:23 1.6 *************** *** 53,60 **** // 2 for the 'HTTP_USER_AGENT' one if ( ($envType == 0 && strcasecmp($name, $str) == 0) ! || ($envType == 1 && eregi('^(' . $key . ')$', $str)) || ($envType == 2 && eregi('(\(|\[|;[[:space:]])(' . $key . ')(;|\]|\))', $str))) { ! $$dbSessionVars['lang'] = $availableAdmins[$key]; $notFound = false; } --- 53,60 ---- // 2 for the 'HTTP_USER_AGENT' one if ( ($envType == 0 && strcasecmp($name, $str) == 0) ! || ($envType == 1 && eregi('^(' . $key . ')(;q=[0-9]\\.[0-9])?$', $str)) || ($envType == 2 && eregi('(\(|\[|;[[:space:]])(' . $key . ')(;|\]|\))', $str))) { ! $dbSessionVars['lang'] = $availableAdmins[$key]; $notFound = false; } *************** *** 109,114 **** else if (!empty($HTTP_ACCEPT_LANGUAGE)) { ! $accepted = explode(',', $HTTP_ACCEPT_LANGUAGE); ! pmcAdminDetect($accepted[0], 1); } --- 109,119 ---- else if (!empty($HTTP_ACCEPT_LANGUAGE)) { ! $accepted = explode(',', $HTTP_ACCEPT_LANGUAGE); ! $acceptedCnt = count($accepted); ! reset($accepted); ! for ($i = 0; $i < $acceptedCnt && empty($dbSessionVars['lang']); $i++) ! { ! pmcAdminDetect($accepted[$i], 1); ! } } |