[Catalyst] Multilanguage application

Matt S Trout dbix-class at trout.me.uk
Thu Aug 10 16:39:12 CEST 2006

Renaud Drousies wrote:
> Hello,
> I am trying to figure out what would be the best way to have a
> multilanguage support in a catalyst application.
> I thought using a url-based method might be better since this site could
> be visited by people that do not accept cookies, or do not visit it from
> their home computer (and then could not have the Accept-Language header
> set correctly).

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.

More information about the Catalyst mailing list