<?php
/*
 *********************************************************************************************************
 * daloRADIUS - RADIUS Web Platform
 * Copyright (C) 2007 - Liran Tal <liran@enginx.com> All Rights Reserved.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 *********************************************************************************************************
 *
 * Authors:	Liran Tal <liran@enginx.com>
 *
 *********************************************************************************************************
 */

	include_once('library/config_read.php');

	switch($configValues['CONFIG_LANG']) {

		case "en":
			include (dirname(__FILE__)."/en.php");
			break;
		case "ru":
			include (dirname(__FILE__)."/ru.php");
			break;
		case "ro":
			include (dirname(__FILE__)."/ro.php");
			break;
		default:
			include (dirname(__FILE__)."/en.php");
			break;
	}

	// Translation function
	function t($a, $b = null, $c = null, $d = null)
	{
		global $l;

		$t = null;

		if($b === null) {
			$t = isset($l[$a]) ? $l[$a] : null;
		}
		else if($c === null) {
			$t = isset($l[$a][$b]) ? $l[$a][$b] : null;
		}
		else if($d === null) {
			$t = isset($l[$a][$b][$c]) ? $l[$a][$b][$c] : null;
		}
		else {
			$t = isset($l[$a][$b][$c][$d]) ? $l[$a][$b][$c][$d] : null;
		}

		if($t === null) {
			$t = 'Lang Error!';
		}

		return $t;
	}

?>
