[Catalyst] Multilanguage application

Renaud Drousies renaud at linuxaddicts.com
Thu Aug 10 17:39:22 CEST 2006

On Thu, August 10, 2006 4:39 pm, Matt S Trout said:
> sub lang :Chained('/') :CaptureArgs(1) :PathPart('') {
>    my ($self, $c, $lang) = @_;
>    <set lang appropriately>
> }
> sub foo :Chained('/lang') :Args(0) { # /en/foo etc.
> Chained was designed to support this sort of stuff without the need for
> prepare_path hacks, which I've used before but always found a tad ugly.

But then I am not sure to understand how to dispatch actions correctly to
different controllers. This looks like all actions must be defined in the
same controller.

If I have that 'sub lang' in my Root controller, how can I reach my
original 'sub index: Private' in MyApp::C::Foo (or any other action
defined there) so that the Foo controller is used when I request /en/foo?

Sorry if I'm not really clear :)


More information about the Catalyst mailing list