Hi,

I have a website that is translated based on a Locale. I have multiple 
translation files in this directory structure

/language
-/en
--en.mo
-/es
--es.mo
-/fr
--fr.mo

In the Bootstrap I use this line of code to setup the Translator: 
$translate = new Zend_Translate('gettext', $this->_root . '/language', $locale, 
array('scan' => Zend_Translate::LOCALE_DIRECTORY));

The Translator is working perfect everywhere on the page itself, but not in the 
url and also not everywhere in Zend_Navigation.

I found this patch http://framework.zend.com/issues/browse/ZF-7298 and in my 
Bootstrap I have this code to first remove the default router and then add it 
again to use the translate option with the patched 
Zend_Controller_Router_Route_Module.
$router->removeDefaultRoutes();
$dispatcher = $this->_front->getDispatcher();
$request = $this->_front->getRequest();
$compat = new Zend_Controller_Router_Route_Module(array(), $dispatcher, 
$request, true, Zend_Registry::get('Zend_Translate'), 
Zend_Registry::get('Zend_Locale'));
$router->addRoute('default', $compat);

This is only working for simple urls in the default module, but not when the 
translation of Controller names has special characters in it. Then the 
controller can't be found.
And also for urls with an other module than the default, the urls and the 
labels from Zend_Navigation are not translated.

Can someone help me with this problem please? Thanks!

Laurens van Vliet

Reply via email to