DataObjects/Core_domain.php
[Pman.Core] / I18n.php
index 7339009..b6812a0 100644 (file)
--- a/I18n.php
+++ b/I18n.php
@@ -81,7 +81,9 @@ class Pman_Core_I18n extends Pman
     }
      
     
-    function guessUsersLanguage() {
+    function guessUsersLanguage()
+    {
+        $this->sessionState(0);
         
         $lang = !$this->authUser || empty($this->authUser->lang ) ? 'en' : $this->authUser->lang;
         
@@ -270,15 +272,19 @@ class Pman_Core_I18n extends Pman
      * DO NOT USE THIS -- see core_curr_rates dataobject.
      *
      */
-    var $rates = array();
+    
+    
+    
     function loadRates()
-    {
-        if (!empty($this->rates)) {
-            return true;
-        }
+    {   
+        static $rates = array();
         
-        $this->rates = DB_DAtaObject::Factory('core_curr_rate')->currentRates();
+        if (!empty($rates)) {
+            $this->rates = $rates;
+            return;
+        }
         
+        $this->rates = $rates = DB_DAtaObject::Factory('core_curr_rate')->currentRates();
         
     }