Ignore:
Timestamp:
12/17/09 09:26:21 (14 years ago)
Author:
nanardon
Message:
  • add locale selection
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Epoll/View/TT.pm

    r277 r279  
    2929    my ($self, $c) = @_; 
    3030 
     31    my ($locale) = split(';', $c->req->header('Accept-Language')); 
     32    if (my $plocale = ($c->req->param('locale')|| $c->session->{'locale'})) { 
     33        $c->session->{'locale'} = $locale = $plocale; 
     34    } 
     35    $c->languages($locale ? [ $locale ] : ''); 
     36    $c->stash->{locale} = $locale; 
     37 
    3138    $c->stash->{Epoll}{VERSION} = $Epoll::DB::VERSION; 
    3239    Catalyst::View::TT::process($self, $c); 
Note: See TracChangeset for help on using the changeset viewer.