aboutsummaryrefslogtreecommitdiff
path: root/www/inc/l10nget.inc.php
blob: cdc3418a01429a41a07bd7075ae301853c2d3b79 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?php

function get_lang_from_agent($accept) {

	$acceptarr = explode("," , $accept);
	foreach ($acceptarr as $lang) {
		//get rid of trailing garbage
    $lang = preg_replace("/^(.*)\;.*/","\\1", $lang);
		if (is_dir("l10n/$lang")) {
			return $lang;
			exit;
		}
		//no translation for accept language
		return "en";
	}
}
?>