Passing language as variable as url parameter in yii

papic

New Member
i'm having a problem with yii which seems very simple but i can't find an appropriate solution for it. I need to do I18N in web page and i'm using yii, i have translations already done, i found that it's possible to easily change language in controller class like that:\[code\]class Controller extends CController{ function init() { parent::init(); if(isset($_GET['lang'])) { Yii::app()->language = 'lt'; } }}\[/code\]Everything is ok, but obviously the language parameter is lost when url doesn't contain the language parameter. One way around is adding the parameter in all urls across whole site, but that doesn't seem like a solution.Is there some more static way of passing the parameter? Maybe some option in UrlManager in yii? Or maybe there is another way of changing the language more dynamically?
 
Back
Top