diff --git a/MLUrlManager.php b/MLUrlManager.php index b2f5295..b52d0ac 100644 --- a/MLUrlManager.php +++ b/MLUrlManager.php @@ -54,6 +54,13 @@ public function createUrl($route,$params=array(),$ampersand='&') { */ public function parseUrl($request) { $this->_currentUrl = parent::parseUrl($request); + foreach ($this->languages as $v) { + if (substr($this->_currentUrl, 0, strlen($v) + 1) == $v.'/') { + $this->_currentUrl = substr($this->_currentUrl, strlen($v) + 1); + $_GET['language'] = $v; + break; + } + } if (isset($_GET['language'])&&in_array($_GET['language'],$this->languages)) { Yii::app()->language = $_GET['language']; Yii::app()->user->setState('language',$_GET['language']);