Home » Internationalization » Translation2 » Bug #5170
setLang will not work
Details
| Submitted | 2005-08-21 19:48 UTC |
|---|---|
| From | michael at klink dot ws |
| Assigned | quipo |
| Status | Bogus |
| Package | Translation2 |
| PHP Version | 5.0.5 |
| OS | win xp |
| Roadmaps | (Not assigned) |
Comments
[2005-08-21 19:48 UTC] michael at klink dot ws
Description:
------------
setLang() sets no language.
Test script:
---------------
final public function _translation() {
$this -> _connection -> setLang('de');
$this -> _connection -> setPageID($this -> _goup);
$this -> _connection =& $this -> _connection -> getDecorator("Lang");
$this -> _connection -> setOption("fallbackLang", "de");
$this -> _connection =& $this -> _connection -> getDecorator("Lang");
$this -> _connection -> setOption("fallbackLang", "en");
foreach($this -> _connection -> getLangs() as $key => $value) {
$this -> _connection =& $this -> _connection -> getDecorator("Lang");
$this -> _connection -> setOption("fallbackLang", $key);
}
if(is_array($this -> _translation)) {
$this -> _connection -> setParams($this -> _translation);
$this -> _connection = $this -> _connection -> get($this -> _translation[0]);
}
else {
$this -> _connection = $this -> _connection -> get($this -> _translation);
}
}
Actual result:
--------------
Warning: No valid language set. Use Translation2::setLang(). in D:\SERVER\Projekte\pear\PEAR.php on line 762