edk
(Edwardkoo)
1
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
English|中文
Welcome Home!
English|中文
欢迎!
What’s the best way to do this?
soter
(Varza1999)
2
edk
(Edwardkoo)
3
Hi, i notice your sample code
$this->widget(‘ext.components.language.XLangMenu’, array(
'items'=>array('et'=>'Eesti','en'=>'In English'),
'hideActive'=>false,
));
If i change to
$this->widget(‘ext.components.language.XLangMenu’, array(
'items'=>array('zh'=>'中文','en'=>'English'),
'hideActive'=>false,
));
the editor cannot save the source code file due to the word ‘中文’

jkofsky
(Jkofsky)
4
Can/Is your editor saving to UTF, or ASCII?
edk
(Edwardkoo)
5
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
http://www.yiiframework.com/extension/langurlmanager/#hh3
http://www.yiiframework.com/wiki/26/
Which one is the best practise?
edk
(Edwardkoo)
6
Just for info i end up using this
http://www.yiiframework.com/wiki/294/seo-conform-multilingual-urls-language-selector-widget-i18n/
very clear explaination and instructions.
Anyway, thanks all for the advices.