Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.9.0
-
Fix Version/s: 1.9.2
-
Component/s: Zend_Translate
-
Labels:None
Description
I have come across an issue in Zend_Translate_Adapter with the use of numeric keys in a translation file. In the translation file (CSV) I have a couple of keys for translating formRadio-Labels:
4;Vor mehr als 4 Wochen
2;Vor weniger als 4 Wochen
0;Neueinzug
In Zend_Translate_Adapter the keys get mangled up, I have tracked the issue down to the use of array_merge on Line 481 in the method _addTranslationData
{{$this->_translate[$key] = array_merge($this->_translate[$key], $temp[$key]);}}
array_merge does not preserve numeric key values. The issue could be fixed by changing the line to
{{$this->_translate[$key] = $this->_translate[$key] + $temp[$key];}}
Using the union operator, the translation works fine again.
And you know that using numeric keys for translation is a absolute no go and not supported ?