[Catalyst] transforming a Catalyst uni-lang app into a multi-lang one

Zbigniew Lukasiak zzbbyy at gmail.com
Fri Oct 19 14:48:57 GMT 2007


On 10/19/07, Jonas Alves <jonas.alves at gmail.com> wrote:
>
>
> On 19/10/2007, Octavian Rasnita <orasnita at gmail.com> wrote:
> > Hi,
> >
> > I've made a site using Catalyst that uses a single language, and now I
> want
> > to transform it into a multi language site and I don't know which would be
> > the most easy method.
> >
> > I use Catalyst::Plugin::I18N and I already made the translations, modified
> > the TT templates and controllers, but I don't know how to do some things.
> >
> > I want to print on each page some links that can be used for changing the
> > language, and I want those links to contain the URI of the current page,
> > with the single difference the code of the language in a query string like
> > &lang=en.
> >
> > I don't know how to do that, because in the templates I might be able to
> get
> > the URI of the current web page, but I don't know how to search if the URI
> > contains something like lang=en and change it with lang=fr, or if it
> doesn't
> > contain that and I need to add it.
> >
>
> Why not use $c->uri_with(lang => $lang) ?
>

Another option would be to use Chained and have the lang at the
beginning of the path - like "/en/some_controller/some_method".

The cookie solution is completely damaged.

-- 
Zbigniew Lukasiak
http://brudnopis.blogspot.com/



More information about the Catalyst mailing list