<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of TranslateController
 *
 * @author krun
 */
class TranslateController extends MainController implements ControllerInterface {

	public function IndexAction($param) {
		
	}

	public function JsAction($param) {
		$this->setAjaxRender();
		Dictionary::Init($param['lang']);
		//Utils::ArrayDisplay(Dictionary::$allLangs);
		$lang = Dictionary::$allLangs[Router::$curLang];

		foreach ($lang as $k => &$v) {
			$v = str_replace("\n", " ", $v);
			$v = str_replace("\r", " ", $v);
			$v = str_replace("\t", " ", $v);
			$v = str_replace("  ", " ", $v);
			$v = str_replace("  ", " ", $v);
			$v = str_replace("  ", " ", $v);

			$v = str_replace("'", "\'", $v);
		}

		$this->smarty->assign('lang', $lang);
//		Utils::ArrayDisplay($lang);
	}

	public function PreDispatch($param) {

	}

	public function PostDispatch($param){
		
	}
}
?>
