4 require_once
'Services/Language/interfaces/interface.ilLanguageDetector.php';
33 if (strlen($this->header_value)) {
36 preg_match_all(
'/([a-z]{1,8}(-[a-z]{1,8})?)\s*(;\s*q\s*=\s*(1|0\.[0-9]+))?/i', $this->header_value, $matches);
37 if (count($matches[1])) {
38 $langs = array_combine($matches[1], $matches[4]);
39 foreach ($langs as
$lang => $val) {
45 arsort($langs, SORT_NUMERIC);
47 $keys = array_keys($langs);
48 if (isset(
$keys[0])) {
49 return substr(
$keys[0], 0, 2);
54 require_once
'Services/Language/exceptions/class.ilLanguageException.php';
Class for language related exception handling in ILIAS.
Interface ilLanguageDetector.
Class ilHttpRequestsLanguageDetector.
__construct($header_value)
for($i=1; $i<=count($kw_cases_sel); $i+=1) $lang
getIso2LanguageCode()
Returns the detected ISO2 language code.