views:

357

answers:

2

Hi, I would do something similar to this in PHP:

http://mysite.com/en/museum/gallery/garden

http://mysite.com/es/museo/galeria/jardin

It's possible? How can I route the controllers / views using multiple languages?

I was wondering if it could be possible with gettext, translating the url automatically, depending on the selected language...

Any ideas?

Thank you

+1  A: 

If you're using Zend as the MVC framework, it has built in support with Zend Translate. Jason Gilmore wrote a short tutorial on the subject using Zend Translate (and there are more out there).

However, I have no clue if the controllers will be translated (I've never used it) - but I doubt it. Probably you will have to write routing rules for the controllers and actions, instead of creating new, spanish, controllers.

Björn
A: 

I use a Model called translations which returns an array of language translations so that when I replace variables in the View, I get them in a language of choice.

As for the route, you might leave that to the Controller that takes care of the /garden or /jardin bit.

Radek