<?php 
	/* $Id: class.codecv.inc.php,v 1.3.16.1 2004/09/27 10:08:27 kazuyan Exp $ */
	
	if (empty($GLOBALS['phpgw_info']['user']['preferences']['common']['lang']))
	{
		$userlang = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
		$lang_array =explode(',', $userlang);
		@reset($lang_array);
		while (list(, $userlang) = @each($lang_array))
		{
			if (ereg('(.*);(.*)|(.*)-(.*)', $userlang, $regs))	// For Opera Browser
				$userlang = $regs[1];
			break;
		}
		$lang_list = $GLOBALS['phpgw']->common->getInstalledLanguages();
		if (@array_key_exists('ja', $lang_list))
			$default_lang = 'ja';
		else
			$default_lang = 'en';
		$userlang = $userlang ? $userlang : $default_lang;
	}
	else 
		$userlang = $GLOBALS['phpgw_info']['user']['preferences']['common']['lang'];

	include(PHPGW_API_INC . '/class.codecv_' . $userlang . '.inc.php');
?>
