phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] CVS: phpgwapi/inc class.translation_sql.inc.php,1.11,


From: Miles Lott <address@hidden>
Subject: [Phpgroupware-cvs] CVS: phpgwapi/inc class.translation_sql.inc.php,1.11,1.12
Date: Tue, 19 Feb 2002 23:44:21 -0500

Update of /cvsroot/phpgroupware/phpgwapi/inc
In directory subversions:/tmp/cvs-serv26160

Modified Files:
        class.translation_sql.inc.php 
Log Message:
Modify to go back to old behavior (load langs only on first use of translate()



Index: class.translation_sql.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/class.translation_sql.inc.php,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** class.translation_sql.inc.php       20 Feb 2002 04:30:19 -0000      1.11
--- class.translation_sql.inc.php       20 Feb 2002 04:44:19 -0000      1.12
***************
*** 29,34 ****
        {
                var $lang = array();
!               var $userlang   = '';
                var $currentapp = '';
  
                /*!
--- 29,35 ----
        {
                var $lang = array();
!               var $userlang   = 'en';
                var $currentapp = '';
+               var $loaded = False;
  
                /*!
***************
*** 44,54 ****
                                $this->userlang = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['lang'];
                        }
-                       else
-                       {
-                               $this->userlang = 'en';
-                       }
  
                        $this->currentapp = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
  
                        $sql = "SELECT message_id,content FROM phpgw_lang WHERE 
lang LIKE '" . $this->userlang
                                . "' AND (app_name LIKE '" . $this->currentapp
--- 45,54 ----
                                $this->userlang = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['lang'];
                        }
  
                        $this->currentapp = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               }
  
+               function load_langs()
+               {
                        $sql = "SELECT message_id,content FROM phpgw_lang WHERE 
lang LIKE '" . $this->userlang
                                . "' AND (app_name LIKE '" . $this->currentapp
***************
*** 76,79 ****
--- 76,80 ----
                           it could be done here. - $GLOBALS['lang'] = 
$this->lang;
                        */
+                       $this->loaded = True;
                }
  
***************
*** 93,97 ****
                        $_key = strtolower($key);
  
!                       $ret = $this->lang[$_key] ? $this->lang[$_key] : $key . 
'*';
  
                        $ndx = 1;
--- 94,103 ----
                        $_key = strtolower($key);
  
!                       if(address@hidden($this->lang[$_key]) && !$this->loaded)
!                       {
!                               $this->load_langs();
!                       }
! 
!                       $ret = @isset($this->lang[$_key]) ? $this->lang[$_key] 
: $key . '*';
  
                        $ndx = 1;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]