I have two domains, one ending in .hr and one ending in .eu
.eu is parked domain and I want to be able to display different languages according to domain that visitor uses.
So, if visitor use mysite.hr, I want to display pages in Croatian, and for mysite.eu in German.
How I can achieve this?
Using UrlManager (and if yes, how?) or is better to put some custom logic in init() function of my base controller and change Yii::app()->language accroding to result of this check?
switch($_SERVER['SERVER_NAME']){
case 'mydomain.eu': Yii::app()->setLanguage('es_ES');break;
case 'mydomain.com': Yii::app()->setLanguage('en_US');break;
}
btw, check out this translate module I just posted