aboutsummaryrefslogtreecommitdiff
path: root/www/inc/l10nget.inc.php
blob: f04b18c263ccf0913d4e2b96664b58bf4265a149 (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 = ereg_replace("^(.*)\;.*","\\1", $lang);
		if (is_dir("l10n/$lang")) {
			return $lang;
			exit;
		}
		//no translation for accept language
		return "en";
	}
}
?>