--- accwhizz.old/login.php Tue Sep 10 21:36:52 2002 +++ accwhizz/login.php Tue Sep 17 20:40:24 2002 @@ -193,7 +193,23 @@ if (! $prefs->account_id) { - $GLOBALS['phpgw_info']['user']['preferences']['common']['lang'] = 'en'; + // get installed languages + $lang_list = $GLOBALS['phpgw']->common->getInstalledLanguages(); + // if English is installed, then default to it + if ($lang_list['en']) + { + $def_lang = 'en'; + } + else + { + // if English is NOT installed, then default to first found language + while (list($key,$value) = each($lang_list)) + { + $def_lang = $key; + break; + } + } + $GLOBALS['phpgw_info']['user']['preferences']['common']['lang'] = $def_lang; } else { @@ -211,9 +227,29 @@ { // If the lastloginid cookies isn't set, we will default to english. // Change this if you need. - $GLOBALS['phpgw_info']['user']['preferences']['common']['lang'] = 'en'; + // get installed languages + $lang_list = $GLOBALS['phpgw']->common->getInstalledLanguages(); + // if English is installed, then default to it + if ($lang_list['en']) + { + $def_lang = 'en'; + } + else + { + // if English is NOT installed, then default to first found language + while (list($key,$value) = each($lang_list)) + { + $def_lang = $key; + break; + } + } + $GLOBALS['phpgw_info']['user']['preferences']['common']['lang'] = $def_lang; + // login/logout messages are in common - to be moved to login? + $GLOBALS['phpgw']->translation->add_app('common'); $GLOBALS['phpgw']->translation->add_app('login'); $GLOBALS['phpgw']->translation->add_app('loginscreen'); + // not it is possible to install proper charset + $tmpl->set_var('charset',lang('charset')); if (lang('loginscreen_message') != 'loginscreen_message*') { $tmpl->set_var('lang_message',stripslashes(lang('loginscreen_message')));