ZF-7517: Add isTranslated() method to Zend_Controller_Router_Route

Description

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.


English
Deutsch

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

Comments

Assigning to Ben Scholzen

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.