ZF-2920: Zend_Translate will not downgrade to English if locale set is not available


This is in repsect to ZF-2908

I have made the suggested changes to my code. I know have:

public function preDispatch(Zend_Controller_Request_Abstract $request)
      $locale = new Zend_Locale();
      $translate = new Zend_Translate('csv', 'languages', 'browser', array('scan'=>Zend_Translate::LOCALE_DIRECTORY));
      Zend_Registry::set('Zend_Translate', $translate);

If I don't use:


it seems to display the values of the last language file loaded.

A couple of things to note:

1) My language files are stored like so:


2) If I set my browser to e.g. Cambodian(km) I will only see messageIds in my view. How do I get this to default or downgrade to English. In 1.0.4 using the addTranslation it use to downgrade through the available languages sent by the browser i.e. if I had km -> es -> en in my list it would display English if I did not have km and es translations available.

Also, Zend_Translate is not available Zend_View_Helper_MyHelper via $this->translate, I get an undefined method. The docs seem to say that you can use $this->translate in helpers as long as you store $translate in the registry key Zend_Translate which I have done. $this->translate is available in script views i.e. index.phtml.

Sorry to be a pain!


Duplicate of ZF-2919

I'm assuming this fix is merged to the 1.5 release branch for release with 1.5.1. Please update JIRA if this is not the case.