3
* Web based SQLite management
4
* Multilingual management
5
* @package SQLiteManager
6
* @author Fr�d�ric HENNINOT
7
* @version $Id: SQLite.i18n.php,v 1.25 2006/04/14 15:16:52 freddy78 Exp $ $Revision: 1.25 $
30
* @param $tableau array
32
function GestionLangue($tableau){
33
global $currentLangue;
34
if(is_array($tableau)){
35
$this->tabText = $tableau;
38
$this->encoding = $GLOBALS["charset"];
43
* Get the good text to display
46
* @param $index int numero du message
47
* @param $default string message par d�faut
49
function get($index,$default='No translate'){
51
if(isset($this->tabText[$index]) && $this->tabText[$index]){
52
$res = @htmlentities($this->tabText[$index],ENT_NOQUOTES,$this->encoding);
53
$res = str_replace('<','<',$res);
54
$res = str_replace('>','>',$res);
55
$res = str_replace('&','&',$res);
64
* Get the good text to display without html entities
67
* @param $index int numero du message
68
* @param $default string message par d�faut
70
function getdirect($index,$default='No translate'){
72
if(isset($this->tabText[$index]) && $this->tabText[$index]){
73
$res = @html_entity_decode($this->tabText[$index], ENT_NOQUOTES, $this->encoding);
82
if(isset($_POST['Langue'])) {
83
$currentLangue = $_POST['Langue'];
84
setcookie('SQLiteManager_currentLangue',$_POST['Langue'],1719241200,'/');
85
$_COOKIE['SQLiteManager_currentLangue'] = $currentLangue = $_POST['Langue'];
86
echo "<script type=\"text/javascript\">parent.location='index.php';</script>";
87
} elseif(isset($_COOKIE['SQLiteManager_currentLangue'])) {
88
$currentLangue = $_COOKIE['SQLiteManager_currentLangue'];
91
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
92
$lang=strtolower(substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0,2));
94
if($lang=='fr') $currentLangue = 1;
95
else $currentLangue = 2;
98
if(file_exists('./lang/'.$availableLangue[$currentLangue].'.inc.php')){
99
include_once './lang/'.$availableLangue[$currentLangue].'.inc.php';
101
include_once './lang/english.inc.php';
104
$traduct = &new GestionLangue($TEXT);