X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=blobdiff_plain;f=I18n.php;h=6536b2f44e818249485c8f8343c6b82a736ff1aa;hp=8367964c9ef63a8bb91a933936131919a577046c;hb=HEAD;hpb=c296361e147ac9c426d1cc83c44c90c042676fa7 diff --git a/I18n.php b/I18n.php index 8367964c..bab0b2d3 100644 --- a/I18n.php +++ b/I18n.php @@ -62,7 +62,7 @@ class Pman_Core_I18n extends Pman //return true; $au = $this->getAuthUser(); //if (!$au) { - // $this->jerr("Not authenticated", array('authFailure' => true)); + // $this->jerror("LOGIN-NOAUTH", "Not authenticated", array('authFailure' => true)); //} $this->authUser = $au; @@ -86,8 +86,7 @@ class Pman_Core_I18n extends Pman $this->sessionState(0); $lang = !$this->authUser || empty($this->authUser->lang ) ? 'en' : $this->authUser->lang; - - /// verify the selected language.. + /// verify the selected language.. $i = DB_DataObject::Factory('I18n'); $i->ltype = 'l'; // string(1) not_null multiple_key $i->lkey = $lang; // string(8) not_null @@ -200,6 +199,10 @@ class Pman_Core_I18n extends Pman $i = DB_DataObject::Factory('I18n'); $ar[$lang]['m'] = $i->toTransList('m', $rlang); } + require_once 'I18Nv2/CurrencyMap.php'; + + $ar['currency_map'] = I18Nv2_CurrencyMap::$s_map; + //echo '
';print_r($ar);
         header('Content-type: text/javascript');
         echo "Roo.namespace('Pman.I18n');";
@@ -231,7 +234,18 @@ class Pman_Core_I18n extends Pman
         if (empty($k)) {
             return '??';
         }
-        $lang = !$au || empty($au->lang ) ? 'en' : is_string($au) ? $au : $au->lang;
+
+        if(class_exists('HTML_FlexyFramework2', false)) {
+            $fo = HTML_FlexyFramework2::get()->HTML_Template_Flexy;
+        }
+        else {
+            $fo = &PEAR::getStaticProperty('HTML_Template_Flexy','options');
+        }
+        
+        $fallback_lang = empty($fo['locale']) ? 'en' : $fo['locale'];
+            
+        
+        $lang =  empty($au ) ? $fallback_lang : (is_string($au) ? $au : $au->lang);
         
         // does it need caching?