parked domain and languages

Hello all,

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?

Give me examples if you can :)

Thank you.


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 ;)

This is probably the approach that I would take. Load different database content depending on the domain.

It would also depend on how similar the page data would be, you could have two fields in each db entry one for each language.

I think you should also look very seriously at Gustavo’s suggestion, this would format numbers etc according to location.

doodle