Changeset 266


Ignore:
Timestamp:
04/18/08 11:39:51 (16 years ago)
Author:
niltonneto
Message:

Internacionalização das mensagens de erros.

Location:
trunk/phpgwapi
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/phpgwapi/inc/class.common.inc.php

    r169 r266  
    313313                                } 
    314314 
    315                                 printf("<b>Error: Can't bind to LDAP server: %s!</b><br>",$dn); 
     315                                echo '<center><b>'.lang("ExpressoLivre is unavailable at this moment. Code %1<br>Please, try later.","002").'</b></center>'; 
     316                                //printf("<b>Error: Can't bind to LDAP server: %s!</b><br>",$dn); 
    316317                                return False; 
    317318                        } 
     
    324325                                        $GLOBALS['phpgw']->log->commit(); 
    325326                                } 
    326                                 printf("<b>Error: Can't bind to LDAP server (anonymous bind): %s!</b><br>",$dn); 
     327                                echo '<center><b>'.lang("ExpressoLivre is unavailable at this moment. Code %1<br>Please, try later.","002").'</b></center>'; 
     328                                //printf("<b>Error: Can't bind to LDAP server (anonymous bind): %s!</b><br>",$dn); 
    327329                                return False; 
    328330                        }                                                
  • trunk/phpgwapi/inc/class.translation_sql.inc.php

    r199 r266  
    126126                                $this->userlang = $GLOBALS['phpgw_info']['user']['preferences']['common']['lang']; 
    127127                        } 
     128                        elseif($GLOBALS['_SERVER']['HTTP_ACCEPT_LANGUAGE']) 
     129                                $this->userlang = $GLOBALS['_SERVER']['HTTP_ACCEPT_LANGUAGE']; 
    128130                        $this->add_app('common'); 
    129131                        if (!count($GLOBALS['lang'])) 
  • trunk/phpgwapi/inc/functions.inc.php

    r2 r266  
    5353                        $vars = array($m1,$m2,$m3,$m4,$m5,$m6,$m7,$m8,$m9,$m10); 
    5454                } 
     55                // Get the translation from Lang File, if the database is down. 
     56                if(!$GLOBALS['phpgw']->translation){ 
     57                        $fn = PHPGW_SERVER_ROOT.'/phpgwapi/setup/phpgw_'.$GLOBALS['_SERVER']['HTTP_ACCEPT_LANGUAGE'].'.lang'; 
     58                        if (file_exists($fn)){ 
     59                                $fp = fopen($fn,'r'); 
     60                                while ($data = fgets($fp,16000)){ 
     61                                        list($message_id,$app_name,$null,$content) = explode("\t",substr($data,0,-1)); 
     62                                        $GLOBALS['phpgw_info']['phpgwapi']['lang'][$message_id] =  $content; 
     63                                } 
     64                                fclose($fp); 
     65                        } 
     66                        $return = str_replace('%1',$vars[0],$GLOBALS['phpgw_info']['phpgwapi']['lang'][$key]);                   
     67                        return $return;   
     68                } 
    5569                $value = $GLOBALS['phpgw']->translation->translate("$key",$vars); 
    5670                return $value; 
     
    163177                /*echo '<center><b>Fatal Error:</b> It appears that you have not created the database tables for ' 
    164178                        .'eGroupWare.  Click <a href="' . $setup_dir . '">here</a> to run setup.</center>';*/ 
    165                 echo '<center><b>ExpressoLivre indisponível no momento. Códgio 001<br>' . 
    166                          'Tente mais tarde.</b></center>'; 
     179                echo '<center><b>'.lang("ExpressoLivre is unavailable at this moment. Code %1<br>Please, try later.","001").'</b></center>'; 
    167180                /* END - CELEPAR - jakjr - 05/06/2006 */ 
    168181                exit; 
Note: See TracChangeset for help on using the changeset viewer.