ZF-8936: Zend Navigation & Zend Translate

Issue Type: Bug Created: 2010-01-26T00:17:25.000+0000 Last Updated: 2011-04-07T07:36:05.000+0000 Status: Open Fix version(s): Reporter: Desi Vanrintel (desiv) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_Controller

Related issues: Attachments:


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


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.

<pre class="highlight">
 * Returns href for this page
 * This method uses {@link Zend_Controller_Action_Helper_Url} to assemble
 * the href based on the page's properties.
 * @return string  page href
public function getHref()
    if ($this->_hrefCache) {
        return $this->_hrefCache;

    if (null === self::$_urlHelper) {
        self::$_urlHelper =

    $params = $this->getParams();

    if ($param = $this->getModule()) {
        $params['module'] = $param;

    if ($param = $this->getController()) {
        $params['controller'] = $param;

    if ($param = $this->getAction()) {
        $params['action'] = $param;

    $url = self::$_urlHelper->url($params,

    return $this->_hrefCache = $url;

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.