zend locale with url routing
Is there a simple way of using zend routes and local开发者_开发问答es in the URL to force the loading of a particular locale?
e.g. - http://domain.com/en-US/controller1/action
So the language-Region should prefix all URL calls and just set the locale in the bootstrap but let the rest of the MVC routing work as normal.
ideally it could detect if no language-Region is in the URL and attempt to autodetect from the browser.
e.g. - http://domain.com/ (if no locale is found - defaults to en-US/index)
I've seen some articles on routes for things like custom user vanity urls. e.g. - http://domain.com/username (routes to http://domain.com/user/load/username)
To me it seems like it should be similar to this, but I was wondering if there's something more elegant?
Thanks,
Andre
I dont want to copy over all the sourcecode, so have a look at
- Zend Framework Best Practices – Part 2: I18n and
- Chaining language with default route
精彩评论