Commit b07ba2ec authored by Francesc Guasch's avatar Francesc Guasch
Browse files

Properly detect browser languages

parent d8089aa4
...@@ -1457,10 +1457,11 @@ sub login { ...@@ -1457,10 +1457,11 @@ sub login {
); );
my $header = ( $c->req->headers->header('accept-language') or ''); my $header = ( $c->req->headers->header('accept-language') or '');
my @languages2 = map {my $lang = $_ ; $lang =~ s/^(.*?)[;-].*/$1/; $lang } split /,/,$header; my @languages2 = map {my $lang = $_ ; $lang =~ s/^(.*?)[;-].*/$1/; $lang } split /,/,$header;
my @languages_browser = map {my $lang = $_ ;$lang =~ s/;.*//; $lang } split /,/,$header;
Ravada::Request->post_login( Ravada::Request->post_login(
user => $auth_ok->name user => $auth_ok->name
, locale => [@languages, @languages2] , locale => [@languages_browser, @languages, @languages2]
); );
$auth_ok = Ravada::Auth::SQL->new(name => $auth_ok->name); $auth_ok = Ravada::Auth::SQL->new(name => $auth_ok->name);
......
Supports Markdown
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