Verified Commit da898ec4 authored by Luc Didry's avatar Luc Didry

Use only first lang cookie sent in i18n before_dispatch hook

parent ee1d7e18
Pipeline #157278 passed with stage
in 1 minute and 17 seconds
......@@ -7,7 +7,7 @@ use Mojo::Util qw(decode);
use Data::Entropy qw(entropy_source);
use ISO::639_1;
our $VERSION = '0.09';
our $VERSION = '0.10';
sub register {
my ($self, $app) = @_;
......@@ -23,7 +23,8 @@ sub register {
$app->hook(
before_dispatch => sub {
my $c = shift;
$c->languages($c->cookie($cookie_name)) if $c->cookie($cookie_name);
my $l = $c->every_cookie($cookie_name)->[0];
$c->languages($l) if $l;
}
);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment