Reputation: 254
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
Upvotes: 2
Views: 2229
Reputation: 3941
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.
Upvotes: 0
Reputation: 29381
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.
Upvotes: 2