From 260ec03378ea79ce3eb10dd0182b7090269776ae Mon Sep 17 00:00:00 2001 From: Henri-Damien LAURENT Date: Wed, 16 Jan 2008 12:32:23 -0600 Subject: [PATCH] BugFixing : default language was always en. Not a problem for dev purpose but would be on installation Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- C4/Output.pm | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/C4/Output.pm b/C4/Output.pm index 2645b4159b..733384fbe4 100644 --- a/C4/Output.pm +++ b/C4/Output.pm @@ -132,28 +132,25 @@ sub themelanguage { # But, if there's a cookie set, obey it $lang = $query->cookie('KohaOpacLanguage') if $query->cookie('KohaOpacLanguage'); # Fall back to English - $lang = 'en' unless $lang; + my @languages = split " ", C4::Context->preference("opaclanguages"); + if ($lang){ + @languages=($lang,@languages); + } else { + $lang = $languages[0]; + } my $theme = 'prog'; my $dbh = C4::Context->dbh; my @languages; my @themes; if ( $interface eq "intranet" ) { - @languages = split " ", C4::Context->preference("opaclanguages"); @themes = split " ", C4::Context->preference("template"); - @languages = ($lang,@languages) if $lang; } else { # we are in the opac here, what im trying to do is let the individual user # set the theme they want to use. # and perhaps the them as well. #my $lang = $query->cookie('KohaOpacLanguage'); - if ($lang) { # FIXME: if $lang always TRUE! - push @languages, $lang; - } - else { - @languages = split " ", C4::Context->preference("opaclanguages"); - } @themes = split " ", C4::Context->preference("opacthemes"); } -- 2.39.5