[med-svn] r661 - trunk/community/website/inc

hanska-guest at alioth.debian.org hanska-guest at alioth.debian.org
Sat Oct 6 16:44:57 UTC 2007


Author: hanska-guest
Date: 2007-10-06 16:44:57 +0000 (Sat, 06 Oct 2007)
New Revision: 661

Modified:
   trunk/community/website/inc/dynlocale.inc.php
Log:
There are good chances I solved the mistery


Modified: trunk/community/website/inc/dynlocale.inc.php
===================================================================
--- trunk/community/website/inc/dynlocale.inc.php	2007-10-06 16:40:53 UTC (rev 660)
+++ trunk/community/website/inc/dynlocale.inc.php	2007-10-06 16:44:57 UTC (rev 661)
@@ -22,6 +22,7 @@
 }
 
 $languages = $_SERVER["HTTP_ACCEPT_LANGUAGE"];
+//$languages = "it-it,it;q=0.8,en-gb;q=0.6,en-us;q=0.4,en;q=0.2";
 $lang_arr = explode(",", $languages);
 $lang_arr[0] .= ";q=1.0";
 
@@ -44,8 +45,8 @@
 
 $__debug = $_SERVER["PHP_SELF"];
 
-//if ($fp = fopen("./inc/locales.txt", "r")) {
-if ($fp = fopen("http://debian-med.alioth.debian.org/inc/locales.txt", "r")) {
+if ($fp = fopen("./inc/locales.txt", "r")) {
+//if ($fp = fopen("http://debian-med.alioth.debian.org/inc/locales.txt", "r")) {
 	while (!feof($fp)) {
 		$raw .= fgets($fp, 4096);
 	}
@@ -64,15 +65,22 @@
 	$installed[$row[0]] = $row[1];
 }
 
+print_r($installed);
+
 foreach ($langs as $index => $language) {
+//	var_dump($language);
+//	var_dump($installed[$language]);
 	if ($installed[$language]) {
 		$locale = $installed[$language];
 		$priority = $index;
+		break;
 	} else {
 		$locale = $def_locale;
 	}
 }
 
+//var_dump($locale);
+
 // we'll use this in a <meta> tag in our header
 // and in the xml declaration.
 preg_match("/([a-z]+)_[A-Z]+/", $locale, $matches);




More information about the debian-med-commit mailing list