ZF-4084: Generation of a "Notice: Undefined index: target-language" using Zend_Translate_Adapter_Xliff
Description
When using Zend_Translate to parse xliff files (generated through translate-toolkit: po2xliff), I end up with the following notice error: Notice: Undefined index: target-language in /home/remy/my_php/ZendFramework-1.5.3/library/Zend/Translate/Adapter/Xliff.php on line 119
I've looked at Oasis xliff 1.2 specification to check if "target-language" attribute of "file" node is mandatory, but it appears it's optional (cf. http://docs.oasis-open.org/xliff/v1.2/…) Line 119 in Zend/Translate/Adapter/Xliff.php "$this->_target = $attrib['target-language'];" could be replaced by "$this->_target = array_key_exists('target-language', $attrib) ? $attrib['target-language'] : null;"
Regards, Remy
Comments
Posted by Thomas Weidner (thomas) on 2008-08-27T12:10:34.000+0000
Sorry, but the actual implementation of Xliff for Zend_Translate
*) is based on Xliff 1.1 *) must have a target-language even if it's optional
This is not a bug but a feature request.
Posted by Thomas Weidner (thomas) on 2008-08-28T12:34:52.000+0000
Feature integrated with r11112
Posted by Wil Sinclair (wil) on 2008-09-02T10:39:20.000+0000
Updating for the 1.6.0 release.