Ian Docherty wrote:
I have been pondering how to take an existing Catalyst application and make it multi-lingual.I would prefer to use a RESTful method, so this would translate /foo/bar to /en/foo/bar or /fr/foo/bar (for English and French respectively).The problem as I see it is how to do this. I don't want to move all my controllers, e.g. MyApp::Controller::Foo::Bar to MyApp::Controller::Lang::Foo::BarWhat other alternatives are there? Regards Ian
Well, I'm sure there's a somewhat elegant way to do this with Chained, but it the other controllers don't use Chained now, that could get fun.
The brute force way is to inspect the request and rip out the language portion before sending it on to get dispatched...just like the Flavour plugin does with file extensions:
sub prepare_path {}
signature.asc
Description: OpenPGP digital signature
_______________________________________________ List: [email protected] Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/[email protected]/ Dev site: http://dev.catalyst.perl.org/
