Return value for caching with Zend Translate Adapter 1.8 has been added
, Thursday, May 28, 2009I wrote my own Zend Translate Adapter. Today, I updated to 1.8.2. Although most of it worked straightforwardly, I had to make some minor modifications. However, one thing was confusing: When file caching was enabled, my translation adapter no longer worked.
I tried to detect what had been changed by comparing my adapter to the current translation adapters. If you compare the _loadTranslationData of version 1.7 and 1.8, you will see the following difference:
$this->_translate[$locale] = $data + $this->_translate[$locale];
In version 1.8, a return value was added and the variable name was changed.
$this->_data[$locale] = $data + $this->_data[$locale];
return $this->_data;
It seems that it does not make any difference that they changed the name to _data instead of _translation, because both names work. When you use version 1.8, it is important to add the return command in your own Translation Adapter. Otherwise, the translation cache is empty.


