Hi,
how can I show layout depending on selected language? And another question, how can I change site language through click in link (what I have to do in my action).
Thanx!
Hi,
how can I show layout depending on selected language? And another question, how can I change site language through click in link (what I have to do in my action).
Thanx!
thanx for quick answer.
And can I widget translate like Controller by file-translation?
Yes.
I have problem with file translation. Method renderPartial() accept "view" parameter that is name of the view to be rendered, but Yii::app()->findLocalizedFile() return path to file. What I have to do that this work?
My code:
$this->renderPartial(Yii::app()->findLocalizedFile(Yii::app()->viewPath . DIRECTORY_SEPARATOR . 'menus' . DIRECTORY_SEPARATOR . 'menuLeft.php','pl',Yii::app()->request->getPreferredLanguage()));
PS
When I use renderPartial like below all work fine:
$this->renderPartial('/menus/en_us/menuLeft');
You don't need to call findLocalizedFile. renderPartial will do this for you. You just need to give the view name like you did in the 2nd code block.