ZF-7517: Add isTranslated() method to Zend_Controller_Router_Route

Issue Type: Improvement Created: 2009-08-07T04:44:51.000+0000 Last Updated: 2012-11-20T20:53:09.000+0000 Status: Closed Fix version(s): Reporter: Thorsten Ruf (saphir2k) Assignee: None Tags: - Zend_Controller

Related issues: Attachments:


In most of my projects i use the new possibility to add translateable routes. In any multilanguage project youhave to provide a language switch. My Project uses a lot of routes, not all of them are multilanguage routes.

To build such a language switch (i.e. in the footer of the page) i define a link for every supported language.

<pre class="highlight">
<a href="">English</a>
<a href="">Deutsch</a>

If the user browse through the page, some of the routes choosen are no multilangue routes and therefore the @locale parameter is build in the url and is not interpreted because the other routes does't know @locale.

First question: Is it possible to ask the router if the choosen route could possible handle multilanguage urls?

Second question: I have seen, in the ...Router_Route Class, the @locale is only interpreted, if a multilanguage segment is defined in the route. At the moment, i have no chance to ask the Route "Do you have multilanguage segments?".

My solution is: - Get the Current Route and check if it is an instance of Zend_Controller_Router_Route - I extend the Router_Route Class and add an method isTranslated() which simply returns the $_isTranslated flag, so i can check this case, too.

Is there an easier way, i have't seen yet?

Regards, Thorsten Ruf


Posted by Matthew Weier O'Phinney (matthew) on 2009-08-07T06:05:35.000+0000

Assigning to Ben Scholzen

Posted by Rob Allen (rob) on 2012-11-20T20:53:09.000+0000

Bulk change of all issues last updated before 1st January 2010 as "Won't Fix".

Feel free to re-open and provide a patch if you want to fix this issue.

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.