[Catalyst] Multi-language and REST

Christopher H. Laco claco at chrislaco.com
Fri Apr 25 14:21:38 BST 2008


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::Bar
> =

> What 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 {}




-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 187 bytes
Desc: OpenPGP digital signature
Url : http://lists.scsys.co.uk/pipermail/catalyst/attachments/20080425/237c=
4839/signature.pgp


More information about the Catalyst mailing list