Issue Type: Bug Created: 2010-04-20T17:26:39.000+0000 Last Updated: 2010-04-22T11:06:11.000+0000 Status: Resolved Fix version(s): - 1.10.4 (28/Apr/10)
Reporter: Vaidotas Stankus (krienas) Assignee: Thomas Weidner (thomas) Tags: - Zend_Translate
Related issues: Attachments:
Thats the way I had initialized Zend_Translation in bootstrap: Zend\_Translate::LOCALE\_FILENAME, 'log' => Zend\_Registry::get('Zend\_Log'), 'logUntranslated' => true, )); Zend\_Registry::set('Zend\_Translate', $translate); ?>
In languages folder create two translation files en.php and lt.php. Internaly those files looks like:'text in english1', 'token2' => 'text in english2' ); ?> This part was working perfectly until I had made upgrade of ZF to 1.10.3. Sad, can't say what version was before. I guess 1.9.x. After some debugging I had realized, that Zend\_Translate\_Adapter\_Array::\_loadTranslationData as $data parameter can accept only string with path to translation or array of such strings for multiple translation files. Zend\_Translate\_Adapter\_Array::\_addTranslationData doesn't do anything with $data value, simply passes it to \_loadTranslationData. But structure of array passed has all (except the first) arguments passed to Zend\_Translate constructor.
If in Zend_Translate_Adapter_Array::addTranslation method after line with this code:\_options; ?> I add something like this: Translations start to work again. If that is really the way component is intended to be used, then I think this issue is feature breaker.
Posted by Vaidotas Stankus (krienas) on 2010-04-20T17:37:49.000+0000
Sorry for editing it so much times, didn't expect it will save all edits..
Posted by Thomas Weidner (thomas) on 2010-04-22T11:06:10.000+0000
Not reproduceable in trunk.
In line 126, if options is a string (note that it should be an array according to API doc) it is converted to array('content' => options) which itself is accepted by addTranslation().
Using your example all works without problems without any changes to the component.
Have you found an issue?
See the Overview section for more details.