Default Language

Donatas V. vyzard@yahoo.com
Tue, 26 Feb 2002 10:05:51 -0800 (PST)


I think I got it solved. 
I had to write one else statement.
THIS SETS SELECT TO MY DEFAULT LANGUAGE.
(by default it sets to "Select another language:")
as i am using imp's authentication,so in
horde/imp/login.php instead of :
if (!$prefs->isLocked('language')) {
    $language = Horde::getFormData('language');
    if (!empty($language)) {
        $horde_language = $language;
        session_register('horde_language');
    }
    $langs = '<select name="new_lang"
onchange="selectLang()">';
    $langs .= '<option value="">' . _("Select another
language:") . '</option>';
    foreach ($nls['languages'] as $key => $val) {
        $sel = ($key == $language) ? '
selected="selected"' : '';
        $langs .= "<option
value=\"$key\"$sel>$val</option>";
    }
    $langs .= '</select>';
}

there should be:

if (!$prefs->isLocked('language')) {
    $language = Horde::getFormData('language');
    if (!empty($language)) {
        $horde_language = $language;
        session_register('horde_language');
    }
    else {$language=Lang::select();}
    $langs = '<select name="new_lang"
onchange="selectLang()">';
    $langs .= '<option value="">' . _("Select another
language:") . '</option>';
    foreach ($nls['languages'] as $key => $val) {
        $sel = ($key == $language) ? '
selected="selected"' : '';
        $langs .= "<option
value=\"$key\"$sel>$val</option>";
    }
    $langs .= '</select>';
}


Sorry for so much code (these two differs only for one
line...), but I wanted to show that clearly.
If it is not right,correct me. For me it worked, I
dont know if it would work for anyone else.

bye




__________________________________________________
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com