Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Minor
-
Resolution: Duplicate
-
Affects Version/s: 1.5.0
-
Fix Version/s: 1.5.1
-
Component/s: Zend_Translate
-
Labels:None
Description
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)); $translate->setLocale('browser'); Zend_Registry::set('Zend_Translate', $translate);
If I don't use:
$translate->setLocale('browser');
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:
languages
-->en
-->lang.en
-->de
-->lang.de
-->fr
-->lang.fr
etc.
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!
Duplicated entry... already answered... see
ZF-2908ZF-2908