source: branches/2.2/expressoMail1_2/inc/load_lang.php @ 3719

Revision 3719, 1021 bytes checked in by eduardoalex, 13 years ago (diff)

Ticket #1507 - expressoMail1_2 - Adicionado array que obtem as traduções.

  • Property svn:executable set to *
Line 
1<?php
2// Load the lang of the module.
3        if(isset($offline_language)) { //Expresso offline, quando o gears sincroniza com uma nova versão, não é dado acesso as sessões do usuário, e é preciso o nome do arquivo de linguagens na session abaixo.
4                $_SESSION['phpgw_info']['expressomail']['user']['preferences']['common']['lang'] = $offline_language;
5        }
6       
7        $array_keys = array();
8        $fn = 'setup/phpgw_'.$_SESSION['phpgw_info']['expressomail']['user']['preferences']['common']['lang'].'.lang';                 
9        if (file_exists($fn)){
10                $fp = fopen($fn,'r');
11                while ($data = fgets($fp,16000)){
12                        list($message_id,$app_name,$null,$content) = explode("\t",substr($data,0,-1));
13                        $expressomaillang[$message_id] =  $content;
14                        $_SESSION['phpgw_info']['expressomail']['lang'][$message_id] = $content;
15                }
16                fclose($fp);
17        }
18       
19        foreach($expressomaillang as $key => $value)
20                $script .= "array_lang['".str_replace("'","\'",strtolower($key))."'] = '".str_replace("'","\'",$value)."';\n";
21        echo "<script type='text/javascript'>$script</script>";
22?>
Note: See TracBrowser for help on using the repository browser.