From: hickert Date: Mon, 13 Aug 2007 07:35:48 +0000 (+0000) Subject: Updated language detection; try to use user settings first, the detect browser language X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=a8ccfb9fea92d5ef2499c1e7f7afe0dd6846de64;p=gosa.git Updated language detection; try to use user settings first, the detect browser language git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@7043 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/include/accept-to-gettext.inc b/include/accept-to-gettext.inc index f04bb4f0b..6bf1950e6 100644 --- a/include/accept-to-gettext.inc +++ b/include/accept-to-gettext.inc @@ -84,9 +84,18 @@ function find_match($curlscore,$curcscore,$curgtlang,$langval,$charval, } -function al2gt($gettextlangs, $mime) { +function al2gt($gettextlangs, $mime) +{ error_reporting(0); + /* Try to use users primary language */ + $ui= get_userinfo(); + if ($ui != NULL){ + if ($ui->language != ""){ + return ($ui->language.".UTF-8"); + } + } + /* default to "everything is acceptable", as RFC2616 specifies */ $acceptLang=(($_SERVER["HTTP_ACCEPT_LANGUAGE"] == '') ? '*' : $_SERVER["HTTP_ACCEPT_LANGUAGE"]); @@ -185,4 +194,5 @@ function al2gt($gettextlangs, $mime) { return $curgtlang; } +// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: ?>