BugFixing : default language was always en. Not a problem for dev purpose but would be on installation

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
Henri-Damien LAURENT 2008-01-16 12:32:23 -06:00 committed by Joshua Ferraro
parent afdf1c6de7
commit 260ec03378
1 changed files with 6 additions and 9 deletions

View File

@ -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");
}