[Catalyst] Multi-language and REST

Bill Moseley moseley at hank.org
Fri Apr 25 15:26:11 BST 2008

On Fri, Apr 25, 2008 at 01:44:38PM +0100, 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

I check if the prefix is a valid language (if it's one of the language
files I loaded at startup), if so I then remove it from the request
path and append it to the request base.

Bill Moseley
moseley at hank.org

More information about the Catalyst mailing list