ZF-8936: Zend Navigation & Zend Translate
Description
I have a error with the following code:
I use the zend application to set up my navigation like here below:
resources.router.routes.tour.route = @tour resources.router.routes.tour.defaults.module = default resources.router.routes.tour.defaults.controller= index resources.router.routes.tour.defaults.action = tour
resources.navigation.pages.main.pages.tour.label = tour resources.navigation.pages.main.pages.tour.module = default resources.navigation.pages.main.pages.tour.controller = index resources.navigation.pages.main.pages.tour.action = tour resources.navigation.pages.main.pages.tour.route = tour
my content is localized, so when i have zend translate doing his translation (using po-files), it works if tour is translated as 'tour' for english and 'rondleiding' for dutch. however, when i translate tour as 'take the tour' for english and 'rondleiding' for dutch, it won't work for english anymore. the url changes to 'take+the+tour', and starts looking for the "take+the+tour" controller
Comments
Posted by Thomas Weidner (thomas) on 2010-03-12T02:14:51.000+0000
Assiging to Zend_Controller/Zend_Navigation as component
Posted by Thomas Weidner (thomas) on 2010-03-12T02:18:38.000+0000
Note that translation of course looks for "take+the+tour".
It seems that the failure is, that Zend_Controller (or Zend_Navigation) searches for a translated route without normalizing the previously url-ized string.
Eighter the string has to be normalized (case sensitivy could also lead to a problem), or the translation must be done url-ized.
For the second, a note within the manual has to be added.
Better would be to solve the problem within the controller.
Posted by Kai Uwe (kaiuwe) on 2011-04-07T07:34:02.000+0000
Remove Zend_Navigation as affected component, because Zend_Navigation only uses the action url helper. The creation of an URL is outside the control of Zend_Navigation. By the way it is not the task of Zend_Navigation to build URLs. Zend_Translate is only used to translate the page labels.