Zend Framework

XLiff adapter always clear previous loaded source

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.7.2
  • Fix Version/s: 1.8.0
  • Component/s: Zend_Translate
  • Labels:
    None

Description

With the example below, only the datas of the last loaded file is kept in the adapter because, during loading the file the array _translate is always reset.

$translate = new Zend_Translate('xliff', APP_PATH."/language/fr");

I think that line below (on Zend_Translate_Adapter_Xliff) must be executed only if the "clear" option is set to true.
125 $this->_translate[$this->_source] = array();
126 $this->_translate[$this->_target] = array();

Activity

Hide
Thomas Weidner added a comment -

Why should someone load the same translation file twice but with changed content ?

Show
Thomas Weidner added a comment - Why should someone load the same translation file twice but with changed content ?
Hide
Cédric Déserville added a comment -

In our application, we use Zend_Translate with scanning directory option.

Example :
My directory APP_PATH."/language/fr" have 4 files :

  • common.xliff (for all common translation like hello, date ...)
  • form.xliff (for all Zend_Validate message)
  • index.xliff (for my Index controller message)
  • test.xliff (for my Test controller message

When i make : $translate = new Zend_Translate('xliff', APP_PATH."/language/fr");

I expect that $translate contains datas of all my xliff files instead of the last loaded files (test.xliff).

that's why I think that line below (on Zend_Translate_Adapter_Xliff) must be executed only if the "clear" option is set to true.
125 $this->_translate[$this->_source] = array();
126 $this->_translate[$this->_target] = array();

Show
Cédric Déserville added a comment - In our application, we use Zend_Translate with scanning directory option. Example : My directory APP_PATH."/language/fr" have 4 files :
  • common.xliff (for all common translation like hello, date ...)
  • form.xliff (for all Zend_Validate message)
  • index.xliff (for my Index controller message)
  • test.xliff (for my Test controller message
When i make : $translate = new Zend_Translate('xliff', APP_PATH."/language/fr"); I expect that $translate contains datas of all my xliff files instead of the last loaded files (test.xliff). that's why I think that line below (on Zend_Translate_Adapter_Xliff) must be executed only if the "clear" option is set to true. 125 $this->_translate[$this->_source] = array(); 126 $this->_translate[$this->_target] = array();
Hide
Thomas Weidner added a comment -

I see no problem.

The looked at the code you are referring to but it does not exist in trunk.
So the related issue can not occur in the next release.

I think we can resolve this issue as it was already addressed before.

Show
Thomas Weidner added a comment - I see no problem. The looked at the code you are referring to but it does not exist in trunk. So the related issue can not occur in the next release. I think we can resolve this issue as it was already addressed before.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved:

Time Tracking

Estimated:
Not Specified
Original Estimate - Not Specified
Remaining:
0m
Remaining Estimate - 0 minutes
Logged:
10m
Time Spent - 10 minutes