<?php
/*
* System class
* @package: PerfCMS
*/
class Lang
{
	public static function get($key, $category = 'main', $params = array())
	{
		if(!file_exists(Yii::app()->basePath.'/messages/'.Yii::app()->language.'/'.$category.'.php'))
		{
			Yii::app()->language = System::getSettings('language');
			return Yii::t($category, $key, $params);
		}
		else
		{
			Yii::app()->language = System::CurrentLang();
			return Yii::t($category, $key, $params);
		}
	}
}
