How to do this simple multi language page (best practise)?

Hi, my yii app homepage content shows "Welcome Home!"

I would like to have a language selector on top of the content which will show different language’s content according to the selection, something like


Welcome Home!



What’s the best way to do this?


Take a look here,



Hi, i notice your sample code

$this->widget(‘ext.components.language.XLangMenu’, array(

'items'=>array('et'=>'Eesti','en'=>'In English'),



If i change to

$this->widget(‘ext.components.language.XLangMenu’, array(




the editor cannot save the source code file due to the word ‘中文’


Can/Is your editor saving to UTF, or ASCII?

Yup, i save the file with notepad in UTF-8 format and works fine now.

Other than Soter’s i also found a few ways to do this

Which one is the best practise?

Just for info i end up using this

very clear explaination and instructions.

Anyway, thanks all for the advices.