From: Konrad Rosenbaum Date: Wed, 28 Mar 2012 17:35:55 +0000 (+0200) Subject: correct language loading and timestamp formatting X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=3a9527520ea761d9b61603fab394bee6c7a7b680;p=web%2Fkonrad%2Fsmoke.git correct language loading and timestamp formatting --- diff --git a/www/inc/classes/language_manager.php b/www/inc/classes/language_manager.php index d981777..c32b345 100644 --- a/www/inc/classes/language_manager.php +++ b/www/inc/classes/language_manager.php @@ -66,8 +66,10 @@ class LanguageManager // 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)); @@ -206,7 +208,7 @@ class LanguageManager //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 diff --git a/www/inc/wext/format.php b/www/inc/wext/format.php index 2a58fb2..095e5aa 100644 --- a/www/inc/wext/format.php +++ b/www/inc/wext/format.php @@ -14,8 +14,15 @@ class WOServerFormat extends WOServerFormatAbstract 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."
"; + if($lang!="" && $lang!="C" && preg_match('/^[a-zA-Z0-9_-]+$/',$lang)){ +// echo "Loading ".$lang."
"; $this->loadConfig($template."/".$lang."/format.cfg"); + }else{ + //fall back to default language +// echo "Loading C as fallback
"; + $this->loadConfig($template."/C/format.cfg"); + } //check timezone $tz=$this->gettimezone(); if($tz==null || $tz==false || $tz==""){