Is there any tutorial or step by step example to change language in blog demo or any?
Thanks,
MP
I made a very simple test and it’s OK. Followings are 4 steps to add the support for french language:
1/ Add following line in protected/views/layout/main.php
$lang = $_GET[‘lang’];//Yii::app()->language;
echo $lang.’<br/>’;
Yii::app()->setLanguage($lang);
echo Yii::t(‘blog’,‘Active record class “{class}” does not have a scope named “{scope}”.’);
2/ Create a folder fr or whatever language you like under protected\messages\
3/ Create message file named blog.php in folder protected\messages\fr\ with the content as belows or whatever text that you want to translate.
return array (
‘Active record class “{class}” does not have a scope named “{scope}”.’ => 'La classe Active record « {class} n\‘a pas de scope nommé « {scope} ».’,
);
4/ Change to french language with uri "index.php?lang=fr"
Please refer to http://www.yiiframework.com/doc/guide/topics.i18n for more details.