X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=blobdiff_plain;f=I18n.php;h=15f1198777992c7f4a6a28569b7a3e61380e63be;hp=e973f902e26153f2019e6bab282f4a9ce3740200;hb=refs%2Fheads%2Fwip_edward_T5851_download_old_offer_sheet;hpb=c7e72d914760d459efcd6df10c82a6b097413630 diff --git a/I18n.php b/I18n.php index e973f902..15f11987 100644 --- 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; @@ -105,7 +107,7 @@ class Pman_Core_I18n extends Pman return explode('_', $lang); } - function get($s ='') + function get($s ='', $opts=array()) { $this->sessionState(0); @@ -187,7 +189,8 @@ class Pman_Core_I18n extends Pman foreach($langs as $lang) { //$rlang = array_shift(explode('_', strtoupper($lang))); - $rlang = array_shift(explode('_', $lang)); + $ll = explode('_', $lang); + $rlang = array_shift($ll); $ar[$lang] = array(); $i = DB_DataObject::Factory('I18n'); @@ -199,6 +202,7 @@ class Pman_Core_I18n extends Pman } //echo '
';print_r($ar);
         header('Content-type: text/javascript');
+        echo "Roo.namespace('Pman.I18n');";
         echo 'Pman.I18n.Data = ' .  json_encode($ar);
         exit;
         
@@ -277,12 +281,12 @@ class Pman_Core_I18n extends Pman
     {   
         static $rates = array();
         
-        if (!empty($this->rates)) {
-            return true;
+        if (!empty($rates)) {
+            $this->rates = $rates;
+            return;
         }
         
-        $this->rates = DB_DAtaObject::Factory('core_curr_rate')->currentRates();
-        
+        $this->rates = $rates = DB_DAtaObject::Factory('core_curr_rate')->currentRates();
         
     }