// check if cookie is set
if (isset($_COOKIE[COOKIE_LANGUAGE])) {
$langs[]= $_COOKIE[COOKIE_LANGUAGE];
+// echo "cookie ".$_COOKIE[COOKIE_LANGUAGE];
}
if(isset($_SERVER["HTTP_ACCEPT_LANGUAGE"])){
+// echo "server lang ".$_SERVER["HTTP_ACCEPT_LANGUAGE"];
foreach(explode(",",$_SERVER["HTTP_ACCEPT_LANGUAGE"]) as $l){
//the language itself
$langs[]=trim(strtolower($l));
//hours
$s=floor($d/60)."";
if(strlen($s)<2)$s="0".$s;
- $t+=$s;
+ $t.=$s;
//T or t? make a colon?
if($format[$i]=='t')$t.=":";
//minutes
parent::__construct();
global $template;
$this->loadConfig($template."/format.cfg");
- if($lang!="" && $lang!="C" && preg_match('/^[a-zA-Z0-9_-]+$/',$lang))
+// echo "Loading base while ".$lang."<br/>";
+ if($lang!="" && $lang!="C" && preg_match('/^[a-zA-Z0-9_-]+$/',$lang)){
+// echo "Loading ".$lang."<br/>";
$this->loadConfig($template."/".$lang."/format.cfg");
+ }else{
+ //fall back to default language
+// echo "Loading C as fallback<br/>";
+ $this->loadConfig($template."/C/format.cfg");
+ }
//check timezone
$tz=$this->gettimezone();
if($tz==null || $tz==false || $tz==""){