3 |
// $Id$ |
// $Id$ |
4 |
// ------------------------------------------------------------------ |
// ------------------------------------------------------------------ |
5 |
// $Log$ |
// $Log$ |
6 |
|
// Revision 1.3 2002/12/04 07:40:05 jonen |
7 |
|
// + comment out dprint |
8 |
|
// |
9 |
|
// Revision 1.2 2002/12/03 03:10:21 joko |
10 |
|
// + bugfix regarding new object hierarchy |
11 |
|
// |
12 |
// Revision 1.1 2002/11/12 05:42:30 joko |
// Revision 1.1 2002/11/12 05:42:30 joko |
13 |
// + initial checkin |
// + initial checkin |
14 |
// |
// |
53 |
// ---------------------------------------------------- |
// ---------------------------------------------------- |
54 |
function LocaleText() { |
function LocaleText() { |
55 |
global $cfg, $slt; |
global $cfg, $slt; |
56 |
//session_register_safe('slt'); |
session_register_safe('slt'); |
57 |
$this->langs_avail = $cfg[GLBL_LANGSAVAIL]; |
$this->langs_avail = $cfg[GLBL_LANGSAVAIL]; |
58 |
$this->load(); |
$this->load(); |
59 |
} |
} |
152 |
|
|
153 |
function setLanguage($langkey_new = "") { |
function setLanguage($langkey_new = "") { |
154 |
global $slt; |
global $slt; |
155 |
if ($langkey_new) { |
//print "setting lang<br>"; |
156 |
|
if ($langkey_new) { |
157 |
$slt[langkey] = $langkey_new; |
$slt[langkey] = $langkey_new; |
158 |
} |
} |
159 |
|
$this->load(); |
160 |
} |
} |
161 |
|
|
162 |
function load() { |
function load() { |
163 |
global $slt; |
global $slt; |
164 |
|
|
165 |
$this->langkey = $slt[langkey]; |
if (!$this->langkey) { $this->langkey = $slt[langkey]; } |
166 |
if (!$this->langkey) { $this->langkey = $this->_findAvailableLanguage($slt[langkey]); } |
if (!$this->langkey) { $this->langkey = $this->_findAvailableLanguage($slt[langkey]); } |
167 |
|
|
168 |
// print "- starting language-library<br>"; |
//print "- starting language-library<br>"; |
169 |
|
//print "lang: " . $this->langkey . "<br>"; |
170 |
//$langkey_new = $this->_detectLanguage(); |
//$langkey_new = $this->_detectLanguage(); |
171 |
//$this->_loadStructure_FromDb(); |
//$this->_loadStructure_FromDb(); |
172 |
//$this->setLanguage($langkey_new); |
//$this->setLanguage($langkey_new); |
187 |
} |
} |
188 |
|
|
189 |
function getlt($key, $tpl=array()) { |
function getlt($key, $tpl=array()) { |
190 |
dprint("getlt: $key"); |
//dprint("getlt: $key"); |
191 |
if ($ldskey = $this->_dbkey2ldskey($key)) { |
if ($ldskey = $this->_dbkey2ldskey($key)) { |
192 |
return $this->_getldsvar($ldskey, $tpl); |
return $this->_getldsvar($ldskey, $tpl); |
193 |
} |
} |