Location: PHPKode > projects > Openmailadmin > openmailadmin-1.0.1/inc/translation.inc.php
<?php
/**
 * @param	id	Catalog ID of localized string to be returned.
 */
function txt($id) {
	global $lang, $res, $default_lang;
	if(isset($res[$lang][$id])) {
		return $res[$lang][$id];
	} else if(isset($res[$default_lang][$id])) {
		return $res[$default_lang][$id];
	} else {
		return '#'.$id;
	}
}

// this will determine which language to use
if(!$cfg['force_default_language']) {
	$tmp_av = explode(',', str_replace(';', ',', $_SERVER['HTTP_ACCEPT_LANGUAGE']));
	if(is_array($tmp_av))
	for($i = 0; $i < count($tmp_av); $i++) {
		if(is_file('inc/lang/'.$tmp_av[$i].'.inc.php')) {
			$lang = $tmp_av[$i];
			break;
		}
	}
}

include_once('./inc/lang/'.$lang.'.inc.php');
include_once('./inc/lang/'.$default_lang.'.inc.php');

?>
Return current item: Openmailadmin