detect user language

This commit is contained in:
Lars Kneschke 2003-09-18 05:06:03 +00:00
parent c80df96eca
commit 719ebac10c

View File

@ -256,7 +256,11 @@
if (! $prefs->account_id)
{
$GLOBALS['phpgw_info']['user']['preferences']['common']['lang'] = 'en';
// Default to the first language, the users browser accepts.
list($lang) = explode(',',$_SERVER["HTTP_ACCEPT_LANGUAGE"]);
$lang = substr($lang,0,2);
if(strlen($lang) != 2) $lang="en";
$GLOBALS['phpgw_info']['user']['preferences']['common']['lang'] = $lang;
}
else
{